Jump to content
  • Advertisement
Sign in to follow this  
zappernapper

damned win api

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok, now i get a linker error when i try to use createpen and draw graphic primitives. it was all sounding so simple in the book, but for some reason i'm having probs with it. the compiler tells me that i'm making an undefined reference when i try to use one of the drawing functions

Share this post


Link to post
Share on other sites
Advertisement
Can you post the exact error messages? Oh and make sure that you are including the libraries in your project. Project-Properties-Linker-Input in Visual C++.

Share this post


Link to post
Share on other sites
Blizzard.o(.text+0x267):Blizzard.cpp: undefined reference to `CreatePen@12'
Blizzard.o(.text+0x27b):Blizzard.cpp: undefined reference to `SelectObject@8'
Blizzard.o(.text+0x291):Blizzard.cpp: undefined reference to `Ellipse@20'
Blizzard.o(.text+0x29f):Blizzard.cpp: undefined reference to `DeleteObject@4'

and i'm using dev, not microsoft. i got the code out of a book, and the cd code compiles fine.... all the include files and liked files appear to be the same

Share this post


Link to post
Share on other sites
Make sure that you link in gdi32.lib into your prject. I think for dev c++ you need to use -lgdi32.a

EDIT: Ah, beaten

Share this post


Link to post
Share on other sites
Quote:
Original post by Drew_Benton
jflanglois - he will need to use either "-lGdi32" or "-libGdi32.a" for Dev-CPP [wink]

Yeah, I wasn't sure how to do it in Dev, and needed to reinstall it.
He could also go to Project->Project Options->Parameters->Add Library or Object.

jfl.

Share this post


Link to post
Share on other sites
it appears to be there. in my compiler options, in libraries, is the folder lib, in that folder is a file called libgdi32.a, looks like the right one to me. is there any preprocessor directive i could try to specifically include that file?

Share this post


Link to post
Share on other sites
well, then that's not what's wrong.... it still gives me the linker error. (oh no... this isn't frustrating..... defenestrates monitor)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!