# [Linker error] undefined reference to GetStockObject@4'

This topic is 3899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I think this is the right place to put this... I'm new to the windows coding scene, and I honestly don't know why this isn't working. To confuse me further, I have another example (written by someone else) that worked... and now it doesnt. Here's where the problem is, what am I doing wrong? (I'm using Dev C++)
      ZeroMemory(&wc, sizeof(WNDCLASSEX));
wc.cbSize=sizeof(WNDCLASSEX);
wc.style=CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.lpfnWndProc=MsgProc;
wc.hInstance=hInstance;
wc.hbrBackground=(HBRUSH)GetStockObject(GRAY_BRUSH);
wc.lpszClassName=strAppname;


As you can see, I'm just making a window... As of right now, this isn't my code, I'm attempting to get myself set up to that I can actually run this stuff, I got this from the example here: http://www.thehavok.scene.org/scene/32bits/tutorials/directx/thebasics/source/win32creation.html Which is where you can see the code I'm using in its entirety. I'm getting an error on the GetStockObject(GRAY_BRUSH); Thanks for any help.

##### Share on other sites
Thanks! I knew it was going to be something stupid.

Back to learning...