Jump to content
  • Advertisement
Sign in to follow this  
Dauid

Unable to compile gdiplus

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

Hi, I just got started with cpp and decided I want to play around with some gamedevelpoment. I'm using Windows XP so I downloaded MinGW32 compiler and Microsoft Platform SDK. So I wrote a basic hello world app and included the gdiplus header. And this won't compile, the compiler errors are hundreds of "invalid use of undefined type", "enumerator value is not integer constant", "forward declaration" and so on. I believed these errors was the cause of the compiler didn't know where the correct libraries and headers were. So I tried to find out how to do this and MinGW was really cryptical about adding searchpaths, I couldn't find a way to add a searchpath directly and apparently all searchpaths you add are RELATIVE to where the sourcefiles are. C:\Program\MinGW C:\Program\Microsoft Platform SDK C:\cpp\game\Main.cpp Can anyone explain to me what to do and post the exact commandline to compile this file? File:Main.cpp ------------ #include <Windows.h> #include <gdiplus.h> using namespace Gdiplus; #include <iostream> int main(){ cout << "Hello World!"; return 0; }

Share this post


Link to post
Share on other sites
Advertisement
I doubt it. GDI+ is very obscure. I read about it while browsing once, tried to use it myself and there was little to no usable information available. GDI+ just exists. I don't think anybody actually uses it. Because you said that you just started programming in C++ is it safe to assume you've never touched just C? If so, just play with GDI. Remember to link libgdi32.a. Microsoft's Platform SDK doesn't come with GCC library types. Even if the headers worked you couldn't link GDI+. Having said that, the program reimp that comes with GCC does a wonderful job of converting Microsoft style libraries (coff?) to GCC style libraries. I used it to convert the pre-compiled DevIL libraries because I didn't want to have to try to compile the whole thing. Alternatively, you can download Microsoft's free (but gutted) version of Visual C++, Visual C++ Express Edition. Also, type your code in between [ source ] and [ /source ] tags w/o the spaces.

Share this post


Link to post
Share on other sites
Quote:
Original post by kittycat768
I doubt it. GDI+ is very obscure. I read about it while browsing once, tried to use it myself and there was little to no usable information available. GDI+ just exists.


There is a complete reference on MSDN.

Quote:
Original post by kittycat768
I don't think anybody actually uses it.


If this is true for C or C++, it is more because very few people are using Win32 to develop GUI apps any more. I believe .NET uses GDI+ internally (the interface in C# is almost identical to the C++ version of the GDI+ library).

To the OP - it is pretty effortless to get GDI+ working with C++ if you use the free Visual Studio Express.

GDI+ uses gdiplus.dll, so you do need some kind of library file to statically link your project to it so you may have trouble with non-MS compilers. Having said that, I'd be suprised if it was impossible to use with MinGW.

Share this post


Link to post
Share on other sites
Quote:
Original post by EasilyConfused
Quote:
Original post by kittycat768
I doubt it. GDI+ is very obscure. I read about it while browsing once, tried to use it myself and there was little to no usable information available. GDI+ just exists.


There is a complete reference on MSDN.

Quote:
Original post by kittycat768
I don't think anybody actually uses it.


If this is true for C or C++, it is more because very few people are using Win32 to develop GUI apps any more. I believe .NET uses GDI+ internally (the interface in C# is almost identical to the C++ version of the GDI+ library).

To the OP - it is pretty effortless to get GDI+ working with C++ if you use the free Visual Studio Express.

GDI+ uses gdiplus.dll, so you do need some kind of library file to statically link your project to it so you may have trouble with non-MS compilers. Having said that, I'd be suprised if it was impossible to use with MinGW.


Really? I had such a hard time finding anything on GDI+ that I just shoved it aside. I think I'm going to try to get a hold of it and use reimp to convert the coff libraries. I don't normally give a hoot about GDI other than the fact that it contains a few OpenGL binding functions. GDI is the snail on the turles back going wohooo! Maybe GDI+ is better.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dauid
I just got started with cpp and decided I want to play around with some gamedevelpoment. I'm using Windows XP so I downloaded MinGW32 compiler and Microsoft Platform SDK.
I'd recommend Microsoft Visual C++ 2008 Express instead, which is far superior for Windows development, and is still free and doesn't have any restrictions on what you do with the games and apps you create with it.

And I know for a fact that GDI+ works just fine with it [smile]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!