The GDI+ library is mandatory for wxGraphicsContext support on Win32. This is no problem if you’re using Visual C++, since the SDK provides the headers and import libraries, but for MinGW there are no such headers and import libraries provided. But there are some sources on the internet where you can get the necessary files.
Elaborate instructions to convert files from the Visual C++ SDK for MinGW usage can be found @ http://wiki.bb4win.org/wiki/Using_GDIPlus_With_MinGW while here you can follow a discussion about an unsuccessful contribution to MinGW (and see what difficulties such projects have).
The most easiest solution seem to be the files provided by wxmax (BlitzMax bindings for wxWidgets) where a zip file containing headers and import library (already altered for MinGW usage) is available for download (local copy). Just copy the files from the “include” directory into C:\MinGW\include (or wherever your MinGW files are) and the file from the “lib” directory into C:\MinGW\lib.
This should be enough to so that MinGW can compile wxWidgets with GDI+ support, e.g.
cd %WXWIN%\build\msw mingw32-make -f makefile.gcc BUILD=release SHARED=1 USE_GDIPLUS=1 set PATH=%WXWIN%\lib\gcc_dll;%PATH% cd %WXWIN%\samples\drawing mingw32-make -f makefile.gcc BUILD=release SHARED=1 USE_GDIPLUS=1 gcc_mswdll\drawing.exe
And voila!

March 30, 2011 at 16:12
Thanks for the instructions. I used these headers to cross-compile wxWidgets on Linux (MinGW with GCC 4.4.4 from Ubuntu gcc-mingw32 package). I only needed to change the case of the filenames and remove extra-qualification in two places. Here is the patch: https://gist.github.com/894515
March 30, 2011 at 16:44
Great that this hint was a help for the fityk projekt – great software!
August 5, 2011 at 18:44
Hello,
I get following error, if I try to compile the gdiplus stuff in wxwidgets
c/msw/graphics.cpp
In file included from c:\mingw-4.4.1\bin\../lib/gcc/mingw32/4.4.1/../../../../in
clude/gdiplus.h:56,
from ../../src/msw/graphics.cpp:92:
c:\mingw-4.4.1\bin\../lib/gcc/mingw32/4.4.1/../../../../include/GdiplusStringFor
mat.h:220: error: extra qualification ‘Gdiplus::StringFormat::’ on member ‘GetTr
imming’
In file included from c:\mingw-4.4.1\bin\../lib/gcc/mingw32/4.4.1/../../../../in
clude/gdiplus.h:59,
from ../../src/msw/graphics.cpp:92:
c:\mingw-4.4.1\bin\../lib/gcc/mingw32/4.4.1/../../../../include/GdiplusMetafile.
h:353: error: extra qualification ‘Gdiplus::Metafile::’ on member ‘EmfToWmfBits’