Linking for GUI's

Justin Hopkins hop@elwood.pionet.net
Thu Jul 10 16:26:00 GMT 1997


At 10:32 PM 7/9/97 -0400, you wrote:
>Hi all, I have a very simple question that I can't seem to find on the
>archives or the FAQ.  I am trying to learn win32 programming with the
>Nuts and Bolts Book by Schildt.  Whenever I try to build the first
>example it compiles fine, but the linker cannot resolve any of the Win32
>Api functions.  The faq only says the most common functions are linked
>and you may need to link other libraries.  What libraries should I add
>to the gcc line to build GUI apps (I have successfully compiled several
>simple standard C and C++ programs with mains but no WinMain into
>console apps).
>                                                                    Herb

Try linking with libuser32.a, and/or libgdi32.a. So your command line 
invocation might be something like this:

	gcc -o mygui.exe mygui.c -luser32 -lgdi32

Justin Hopkins

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list