Can I use two versions of libstdc++ in one single executable?

Feng Chen fchen@pingtel.com
Mon Jul 1 14:13:00 GMT 2002


Hello there:

We have a project on Linux that uses both our own libraries and third party
libraries.  However, there is a problem to build this project because the
third party libraries can only be built using gcc 3.0.2, while our own
libraries can only be built with gcc 2.9.6 - compiler errors are primarily
because of the iostream stuff - see the example below:

/usr/local/gcc-3.0.2/include/g++-v3/backward/iostream.h:35: using directive
   `ostream' introduced ambiguous type `ostream'
/usr/local/gcc-3.0.2/include/g++-v3/backward/iostream.h:36: using directive
   `istream' introduced ambiguous type `istream'
/usr/local/gcc-3.0.2/include/g++-v3/backward/iostream.h:37: using directive
   `ios' introduced ambiguous type `ios'

My questions are:

a) Is there a way to build something using gcc 3.0.2 while using a previous
version of the libstdc++?  Maybe some build switches?

b) If the answer to a) is yes, will the final result work properly, i.e.,
with two different copies of the c++ std libraries running at the same time?

Thanks very much for your help.

Feng Chen



More information about the Libstdc++ mailing list