Sign in to follow this  

damned win api

This topic is 4596 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
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
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

This topic is 4596 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this