Gcc 4.7.2 virtual function error

A bug is known in gcc 4.7.2 for MinGW, which causes an invalid pointer thisthat must be passed to a virtual function in some cases, which include virtual and non-virtual inheritance in the same class. Details are on this Bugzilla page .

This bug bit me, and I need to fix it for the Qt application I am writing. There is a patch on the Bugzilla page, but how do I get a working version that includes this patch? As far as I can tell, the GNU download page provides only the original, buggy version. And the next version of gcc after 4.7.2 is 4.8.0, which I cannot use because it will not be compatible with my Qt libraries.

Should I build gcc from sources after applying the patch? Of course, I want to avoid this if I can!

+5
source share
1 answer

I took Haroogan's advice (to rebuild Qt from source), but with GCC 4.8.0 instead of GCC 4.7.1. It worked! At least I’ve been using it for three days, and he hasn’t surprised yet. The only glitch is the internal header files in GCC 4.8.0, which apply to them for this patch . In addition, it was a simple swimming (i.e. it took me only two evenings).

Updated to add: Now I notice some problems with the debugger. Therefore, perhaps I spoke too soon!

+1
source

All Articles