thor20123 / wxmax

Automatically exported from code.google.com/p/wxmax
0 stars 0 forks source link

MinGW GDI+ headers cause errors with g++ 4.4.1 #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
0. Install MinGW/MSys
1. Install TDM-2 gcc 4.4.1 from http://www.tdragon.net/recentgcc/
2. download GDI headers from
http://wxmax.googlecode.com/files/gdiplus_includes.zip
3. download wxwidgets sources
4. configure with --enable-graphics_gtx
5. make

What is the expected output? What do you see instead?

The error output is

----------------------------------------------
gw\bin\../lib/gcc/mingw32/4.4.1/../../../../include/gdiplus.h:56,
                 from ../src/msw/graphics.cpp:92:
c:\mingw\bin\../lib/gcc/mingw32/4.4.1/../../../../include/GdiplusStringFormat.h:
220:
error: extra qualification 'Gdiplus::StringFormat::' on member 'GetTrimming'
In file included from
c:\mingw\bin\../lib/gcc/mingw32/4.4.1/../../../../include/gdiplus.h:59,
                 from ../src/msw/graphics.cpp:92:
c:\mingw\bin\../lib/gcc/mingw32/4.4.1/../../../../include/GdiplusMetafile.h:353:
error: extra qualification 'Gdiplus::Metafile::' on member 'EmfToWmfBits'
make: *** [monodll_msw_graphics.o] Error 1
----------------------------------------------

What version of the product are you using? On what operating system?

Microsoft windows, MinGW, and TDM's g++ 4.4.1 (since MinGW hasn't released
a gcc 4 yet).

Please provide any additional information below.

This really isn't much of an issue, and is only tangentially related to
this project, but I just wanted to provide a little information in case
someone else happens to run into the same thing... and they can save
themselves some trouble. To be honest I don't even remember what it was I
was trying to compile that required gcc4 and didn't work with gcc3 (maybe
it was wxWidgets, I can't remember), but in any case anyone who wants to
compile wxWidgets with gcc4 on windows has to use an "unoffical" MinGW
build since the MinGW project doesn't provide one. I'm using the one from TDM.

I downloaded the GDI+ headers from this project, modified for MinGW (thank
you so much). I tried to compile wxWidgets 2.8.10 and 2.9.0 and both failed
with the above error. The solution was to remove the class name prefix from
the static method names in the two offending files. Specifically

GdiplusStringFormat.h:220 
    change StringFormat::GetTrimming(... --> GetTrimming(...

GdiplusMetaFile.h:353
    change Metafile::EmfToWmfBits(... -> EmfToWmfBits(...

After that wxWidgets 2.9.0 compiles just fine (I didn't bother with 2.8.10
since 2.9.0 worked) and my project now compiles and runs fine... evidently
using GDI+ with the graphics context. 

Original issue reported on code.google.com by josh.bia...@gmail.com on 6 May 2010 at 5:54

GoogleCodeExporter commented 8 years ago
I also have this problem with mingw32 gcc4, and the solution solves it, but the 
other class members seem to be written without any class reference, except for 
these two. Why?

Also, I append a patch to solve this problem, since no one has give one.

Original comment by phantom....@gmail.com on 5 Sep 2010 at 9:16

Attachments: