www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - GetStockObject problem

reply murban cbs.umn.edu writes:
Hi all,

I'm having a problem with GetStockObject under Digital Mars, as well as 
minGW32.

The following works fine in Visual C++:

wmainclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);

But when I try to compile this ins Digital Mars or minGW32, I get the following
linker error:

Error 42: Symbol Undefined: _GetStockObject 4

AFAIK, GetStockObject is a standard Win API call, so I don't see why this
isn't working. Can anyone give me a hand?

Thanks!
Dec 08 2003
parent reply Jan Knepper <jan smartsoft.us> writes:
Include GDI32.lib into you project's link phase...


murban cbs.umn.edu wrote:
 Hi all,
 
 I'm having a problem with GetStockObject under Digital Mars, as well as 
 minGW32.
 
 The following works fine in Visual C++:
 
 wmainclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
 
 But when I try to compile this ins Digital Mars or minGW32, I get the following
 linker error:
 
 Error 42: Symbol Undefined: _GetStockObject 4
 
 AFAIK, GetStockObject is a standard Win API call, so I don't see why this
 isn't working. Can anyone give me a hand?
 
 Thanks!
 
 
 
-- ManiaC++ Jan Knepper
Dec 08 2003
parent murban cbs.umn.edu writes:
Oh yeah...

That worked. Thanks. :)

In article <br288p$1uer$1 digitaldaemon.com>, Jan Knepper says...
Include GDI32.lib into you project's link phase...


murban cbs.umn.edu wrote:
 Hi all,
 
 I'm having a problem with GetStockObject under Digital Mars, as well as 
 minGW32.
 
 The following works fine in Visual C++:
 
 wmainclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
 
 But when I try to compile this ins Digital Mars or minGW32, I get the following
 linker error:
 
 Error 42: Symbol Undefined: _GetStockObject 4
 
 AFAIK, GetStockObject is a standard Win API call, so I don't see why this
 isn't working. Can anyone give me a hand?
 
 Thanks!
 
 
 
-- ManiaC++ Jan Knepper
Dec 08 2003