From: Roman W. <rom...@gm...> - 2011-06-20 09:55:37
|
Dear mingw team. I have noticed that vtables generated by mingw are different than those from visualstudio. The incompatible code is generated by such class. class Vtable { virtual void Overloaded(int) = 0; virtual void Overloaded(Vtable&) = 0; virtual void Other() = 0; }; According to what i found here: http://old.nabble.com/Incorrect-vtable-generation-in-MinGW--td15781052.html I have made my code compatible using such prepossessing. class Vtable { #ifdef __GNU__ virtual void Overloaded(Vtable&) = 0; virtual void Overloaded(int) = 0; #else virtual void Overloaded(int) = 0; virtual void Overloaded(Vtable&) = 0; #endif virtual void Other() = 0; }; It is not an example of code I use, but same trick has helped in my problem. I use miingw 4.4, and the becomes compatible with what visual studio 6.0 generates, and as i believe with the newer versions of vs. Is there some compiler option so ming would generate vs compatible vtables? Maybe there is some other way to make a code compatible, some preprocessor macro probably like: class Vtable __gcc_make_MSC_vtables_ { virtual void Overloaded(int) = 0; virtual void Overloaded(Vtable&) = 0; virtual void Other() = 0; }; Any way I think the problem should be described some where on http://www.mingw.org/wiki. |