stdc++ and shared objects

pmills@my-deja.com pmills@my-deja.com
Fri Dec 10 06:30:00 GMT 1999


I've recently moved from 2.8x gcc to 2.95.1 on Solaris 2.6.  There are
some real improvements, but I'm confused about using the C++ standard
libraries.

My application uses a number of shared objects/dynamic libraries (.so
files).  Within that code I use C++ standard classes such as <fstream>,
<map>, and a bunch of others.

With the 2.8 release and libstdc++.so, this worked fine, but with the
static version of stdc++ I'm not sure what I'm supposed to do.  If I
don't link with the .a library, I get unresolved symbols at run time
for anything in my .so that's not also in my primary executable (which
*is* linked against libstdc++.a).  If I try to link my .so explicitly
with libstdc++.a, it fails with a bunch of "Text relocation remains"
errors.  I assume this is because the .a file contents were not
compiled PIC.

Are there instructions somewhere for doing this?  Thanks in advance for
and hints or pointers.


Sent via Deja.com http://www.deja.com/
Before you buy.


More information about the Gcc-help mailing list