Linking gcc 3.2 c++-library to a gcc 2.7 c-executable

Kerola Antti
Mon Dec 16 09:09:00 GMT 2002


I have been looking for answer for the following question
from the gcc documentation and also tried posting to the gcc-help 
mailing list. I did not find any answer so I am posting
this now to the gcc-list hoping that somebody could help
me out. Sorry for the disturbance.

I have a c++-library implemented by another party which 
uses STL and will only compile with gcc 3.x. The library
provides also a C interface with extern "C" -functions.

I need to link this library to a main program, which
is written in C and currently compiles with gcc

Is it possible to do the linking of the executable and the c++
-library with gcc 

I have tried that, and it seems to work even when using gcc
as a C-compiler. Still, I have doubts, for example concerning static 
variables. The library does not have any static variables, but what 
about STL? 

If using gcc as a linker is not viable, do I have
any other options besides using gcc 3.x? 
gcc is our current production compiler and changing 
the production compiler is rather bureaucratic procedure
with management decisions involved. I would not like to
take that route if not necessary.

I am running Sparc/Solaris 8.

Thanks in advance,


Antti Kerola 

More information about the Gcc mailing list