I try to crosscompile a c-tool on linux with mingw. I use the function GdipSaveImageToFile, which i will need. This function is declared in "gdiplus.h".
My code now is:
#include <stdio.h>
#include <windows.h>
#include <gdiplus.h>
int main() {
return 0;
}
Compile-Command:
i586-mingw32msvc-gcc test.c -lgdi32
And the error is:
t开发者_StackOverflow中文版est.c:3:21: Fehler: gdiplus.h: Datei oder Verzeichnis nicht gefunden
In english (i think):
test.c:3:21: Error: gdiplus.h: no such file or directory.
I also tried to include <Gdiplus.h>
, gdi.h
and much others, but no header file exists?
Has anyone an idea why? My operating system is ubuntu 11.04.
best regards
The gdiplus headers are not in the default mingw package. The "normal" way is to use those provided by wxMax:
http://code.google.com/p/wxmax/
You'll have to fix a few case issues, though. I have built that into a debian package gdiplus-dev-mingw-i686-cross at
deb https://idefix.biozentrum.uni-wuerzburg.de/debian experimental main
Your IDE needs to know where to find (the <> tells it to search in predefined locations). In Visual Studio, for example, you can set those locations in the "Include Directories" options. Your IDE must have something similar
If you're using plain mingw, there must also be a way to set the locations to search for include files, check the mingw documentation
One more thing: You might already know this, but windows.h and Gdiplus.h are Windows-specific headers, you won't have them available in Ubuntu unless you do some fiddling
"windows.h" is found, so the path should be configured correctly. I searched it on the system. The path is:
/usr/i586-mingw32msvc/include
And there is the file windows.h
. But if i execute there find .|grep -i gdi
i see only one file (wingdi.h
). And this file doesn't include the function which i need.
After this i executed find . -type f|xargs grep -i GdipSaveImageToFile
, but unfortunaly there is no file found...
Is there a way to install this header files (and their dependencies)?
best regards
-edit-
Or alternativly does a code-file exists which can generate png-files? It this would exist i would use this file.
best regards
精彩评论