From: khan@xraylith.wisc.edu (Mumit Khan)
Subject: Re: undefined reference to `GetStockObject@4' ??
22 Mar 1998 21:14:16 -0800
Message-ID: <9803201646.AA09812.cygnus.gnu-win32@modi.xraylith.wisc.edu>
References: <350F6B30.26F4A777@mail.coos.or.us>
To: thedagit@mail.coos.or.us
Cc: "gnu-win32@cygnus.com" <gnu-win32@cygnus.com>

Jason Dagit <thedagit@mail.coos.or.us> writes:
> 
> I'm a still a newbie and I'm still having troubles.  Could someone help
> me figure out why gcc can't find GetStockObject on my configuration? 
> The command line I use is:
> gcc -ofoo.exe foo.c -lkernel32 -luser32 -Wl,--subsystem,windows 

1. DO NOT use -lkernel32 explicitly. It's a big no no. Let gcc figure out
   this stuff. It causes programs to mysteriously fail at run time.
> 
> My guess is that I'm not linking a lib that I should be.  Or else, one
> of my header files or libs is missing the definition of GetStockObject,
> but that seems less likely.

it's -lgdi32, but -mwindows option should've added that for you.

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