This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Building shared library that uses libstdc++
- To: gcc-help at gcc dot gnu dot org
- Subject: Building shared library that uses libstdc++
- From: "Lundell, Jens O." <JENS dot O dot LUNDELL at saic dot com>
- Date: Fri, 13 Apr 2001 10:40:54 -0700
I want to build a shared library that uses the Standard C++ Library using
Solaris 7 and GCC 2.95.3. I would prefer to statically link the Standard C++
library so I don't have to distribute libstdc++.so.2.10.0. I can create a
shared library like this:
g++ -fPIC -shared -o libjens.so source.cpp
and I can statically link the Standard C++ Library to an executable like
this:
g++ -static -o jensexe source.cpp
but when I combine the two I get the following error:
ld: warning: option -d appears more than once, first setting taken
ld: fatal: option -dn and -z[text|textwarn|textoff] are incompatible
ld: fatal: option -dn and -G are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status
Do I have to distribute libstdc++.so.2.10.0 together with my shared library?
Is so, what happens if the machine already has a different version of
libstdc++, dll-hell?
-Jens