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

Kerola Antti antti.kerola@insta.fi
Mon Dec 16 09:09:00 GMT 2002


Hi

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 2.7.2.2.

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

I have tried that, and it seems to work even when using gcc 2.7.2.2
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 2.7.2.2 as a linker is not viable, do I have
any other options besides using gcc 3.x? 
gcc 2.7.2.2 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



______________________________________________
Antti Kerola 
INSTRUMENTOINTI OY



More information about the Gcc mailing list