Problem when linking objects files from IBM VAC++ and GCC

John Love-Jensen eljay@adobe.com
Tue Dec 6 12:32:00 GMT 2005


Hi Bruno,

C++ object code from different compilers (and often even from different
versions of a compiler) is not compatible with one another.

Why?  Because there is no universal C++ ABI.

To make it compatible you'll need to make a C thunk layer.  The C ABI is (on
most platforms) well defined.

Writing a C thunk layer is a bit of a pain-in-the-backside.  You can't throw
exceptions through a C routine.  If an uncaught exception is propagated, it
will cause the application to abort (unless extraordinary measures are
taken).

The objects cannot be shared in the two different universes.  The RTTI is
incompatible.  Yada yada yada.

My first strong suggestion:  use the same compiler for all your code.  Don't
mix-and-match.

HTH,
--Eljay



More information about the Gcc-help mailing list