Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Programming Talk / C++ / C# - GDI+ errors

Author
Message
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 12th May 2008 02:58
Ok, so i included <gdiplus.h> in my project and all the sudden, i get 121 errors when i compile...what the heck? I included the lib file but still spits them out, any idea on what to do?

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 12th May 2008 08:53
I don't think you have to include gdiplus.h like that. Most of the include files used by native Windows components like GDI+ are included by including windows.h
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 12th May 2008 20:29
well, i just looked at the windows.h and i didn't see a gdiplus.h header onlt wingdi.h

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 13th May 2008 03:27 Edited at: 13th May 2008 03:31
Sometimes, things get included further down. Its pretty complicated, actually. I will try to duplicate it, because the errors you are getting should be clues to the problem, which should be minor.

EDIT: Okay, 121 errors? I'd say that including gdiplus.h is correct, but...have you also included the gdiplus.lib in your linker input? That is probably the source of your errors, which I imagine are "Unresolved external..." errors.

"Unresolved external" = library
"Undeclared identifier" = include file
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 13th May 2008 06:18
Yes, i did add the lib file but by using #pragma comment and i still get these stupid errors....



"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 13th May 2008 07:41
I noticed that you are building a debug configuration. gdiplus.lib is not a debug library, but that should not cause your error.

GDI+ is probably depending on the .NET framework, or another COM interface to be defined in the project. It has the same late-binding as other libraries that are loaded at runtime. (They differ from the static libraries that are still linked to a DLL at runtime, but that are linked automatically by Windows for you.) Notice that it defines UNICODE.
So, anyway....there is a namespace that you need to use in addition to the steps you have already taken.

Have you looked at the Platform SDK documentation? Here is a simple sample from that document:


Are you putting code into stdafx.cpp? (Leave that file alone, its really a dummy file to allow precompiled headers to work. Put the include in either your main source file (best choice), or stdafx.h

Also, you must Rebuild ALL to effect a change in all files that use a PCH. Sometimes, Rebuild is all that is required to sync the files up. The need for the change is not necessarily confined to change in the stdafx,h, or stdafx.cpp files...but you need to rebuild all EVERY time you change those. (Since the compiler cannot know which files of yours to recompile, execpt those that have Use precompiled headers ticked in their properties.)

I sure hope that makes sense.

Login to post a reply

Server time is: 2025-05-25 06:38:40
Your offset time is: 2025-05-25 06:38:40