delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/10/20:26:53

From: hop AT elwood DOT pionet DOT net (Justin Hopkins)
Subject: Re: Linking for GUI's
10 Jul 1997 20:26:53 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <3.0.1.32.19970710163057.00693dd4.cygnus.gnu-win32@elwood.pionet.net>
Mime-Version: 1.0
X-Sender: hop AT elwood DOT pionet DOT net
X-Mailer: Windows Eudora Light Version 3.0.1 (32)
Original-To: gnu-win32 AT cygnus DOT com
In-Reply-To: <33C4499A.DAF49497@domain.com>
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019