delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/03/24/18:22:11

From: jrogers AT cascadenet DOT com (John D. Rogers)
Subject: Re: undefined reference to `GetStockObject AT 4' ??
24 Mar 1998 18:22:11 -0800 :
Message-ID: <35126B65.157.cygnus.gnu-win32@cascadeinc.com>
References: <350F6B30 DOT 26F4A777 AT mail DOT coos DOT or DOT us>
Mime-Version: 1.0
To: thedagit AT mail DOT coos DOT or DOT us
Cc: "gnu-win32 AT cygnus DOT com" <gnu-win32 AT cygnus DOT com>

Jason Dagit wrote:
> 
> Hello,
> 
> 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
> 
> 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.
> 
> The line in my code that called GetStockObject is:
> wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
> 
> Thank you,
> Jason
> -
> 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".


I believe GetStockObject is in gdi32, so add "-lgdi32" to your cmd line.
 
John D. Rogers
jrogers AT cascadenet DOT com
jrogers AT world DOT std DOT com
-
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