Mixing G++ 2.95.3 and G++ 3.2 libs

Martin Apel apel@human-solutions.com
Mon Jan 27 10:36:00 GMT 2003


Hi,

I am trying to build a program which contains shared libraries generated with G++ 2.95
and G++ 3.2. I know that this is normally not supposed to work at all, but there is one
important restriction which might allow it nevertheless. These libraries are only called
via C interfaces, i.e. there is no C++ code in one library calling C++ in the other library
directly. You can view these libraries as being independent or self-contained with only
C interfaces to the outside world.

Because the name-mangling has changed between 2.95 and 3.2 I have successfully linked
a program giving it two stdc++ libraries (the ones used with each version).
The program works more or less, but there is one feature which does not work:
dynamic_casts seem to lead to a crash, because the function performing the cast
is exported with C naming as __dynamic_cast by both stdc++ libraries. It seems
the 2.95 version is always used, whereas the dynamic_casts are contained in the library built
with 3.2. Reversing the order of libraries on the link line does not solve the problem.

The gcc 2.95 libraries are provided by a third party vendor, so there is currently no
hope of recompiling them using GCC 3.2. The other part is fully under our control, but
the code uses standard ANSI features, which are not implemented in 2.95.

Any hints how to solve this problem?

Best Regards,

Martin Apel
________________________________________________________________________
Bitte beachten Sie, daß der Geschäftsbereich Human Solutions der tecmath AG
seit dem 1. Oktober 2002 in ein eigenständiges Unternehmen abgespalten
wurde. Bitte ändern Sie Ihre Datenbank entsprechend.

Please note that from 1st. of October 2002, the Human Solutions Division of
tecmath AG will form an independent company, the Human Solutions GmbH.
Please make the relevant changes to your database .

Martin Apel, Dipl.-Inform.                          Human Solutions GmbH
Group Manager Software Development
phone +49 (0)631 303-5600           Europaallee 10, 67657 Kaiserslautern
fax   +49 (0)631 303-5700                                        Germany
apel@human-solutions.com                  http://www.human-solutions.com
________________________________________________________________________




More information about the Gcc-help mailing list