gcc - How to add gdi32.lib from command line -
i have found example gdi32.lib should linked in way, don't know how gcc command line. examples i've found suggest somewhere in project properties in ms visual studio or eclipse.
bsod.cpp:
#include <windows.h> int main() { hdc dc = createcompatibledc (null); setlayout (dc, layout_rtl); scalewindowextex (dc, -2147483647 - 1, -1, 1, 1, null); }
my gcc compiler ruby development kit (seems mingw).
just add link command line:
-lgdi32
so e.g. link line like
gcc -o executable somemain.o -lgdi32
make sure library specified after needs it.
for example, if have single c++ source file named myprog.cpp
, run
g++ -o myprog myprog.cpp -lgdi32
or seperate commands
g++ -c myprog.cpp g++ -o myprog myprog.o -lgdi32
you can add optimization or debug options first 2 commands. link command doesn't need else.
Comments
Post a Comment