From: Thomas Gerstner <gerstner.thomas@si...> - 2004-09-22 09:05:55
I've tried to link an object file generated with a =
to my mingw-compiler application. Both are compiled for c++. The =
crashes when the "rtems"-function tries to access a virtual method in a
class compiled into the mingw application. Looking at the assembly code =
both objects showed my that they address the vtable differently. The GCC
version for mingw and rtems is 2.95.3 and I didn't expected this =
I seems that mingw does not define "DEFAULT_VTABLE_THUNKS" in one of the
compiler sources header files and therefor has a different structure of =
vtable then some other compilers (namely linux and rtems) that define =
value. Setting this define or just give g++ the "-fvtable-thunks" option =
the command line produces identical code to rtems/linux compilers for
Does anyone know why there is a difference in mingw? Is a different =
really needed for windows programming?
BTW, until know I thought that the same GCC version produces the same
compatible and linkable code as long as the processor is the same, but =
seems to be other differences...
Thomas Gerstner wrote:
> Is a different vtable
> really needed for windows programming?
IIRC, '-fvtable-thunks' used to be required for 'ole'
support, though not for all msw programs. But that gcc
option caused problems with multiple inheritance. It's
a small nightmare that doesn't matter with modern gcc
versions; your 2.95.3 is really quite old.