help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can we link an application with different libstdc++.so.x version?


From: praks
Subject: Can we link an application with different libstdc++.so.x version?
Date: Wed, 23 Jul 2008 09:28:26 -0700 (PDT)
User-agent: G2/1.0

Hi,

We want to build an application which requires 3rd party libraries.
The 3rd party shared libraries strictly require "libstdc++.so.5" and
we don't have source code of these libs. We are using gcc 3.4.x to
build main application . We have been able to build and link main
application with these libraries by using following gcc options:
#g++ -rdynamic -g -o app /usr/lib/librt.so /usr/lib/libdl.so /usr/lib/
libcrypt.so /usr/lib/libpthread.so /usr/lib/libstdc++.so.5 -
l3rdPartyLib1

#ldd app
        librt.so.1 => /lib/tls/librt.so.1 (0x00c0e000)
        libdl.so.2 => /lib/libdl.so.2 (0x004ac000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x0028d000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x005b8000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x00654000)
        lib3rdPartyLib1.so => /usr/lib/lib3rdPartyLib1.so (0x0070d000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00111000)
        libm.so.6 => /lib/tls/libm.so.6 (0x004b2000)
 ...
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x001dc000)
        libc.so.6 => /lib/tls/libc.so.6 (0x0037f000)
        /lib/ld-linux.so.2 (0x00361000)
#

It builds and runs fine on my dev ( rhel 4.0 )  machine. But it
doesn't work in the build that we gave to QA, we are getting a segv in
static initialization of objects. This seems to stem from the fact
that we have two versions of libstdc++ linked in the application viz.
"libstdc++.so.5" (explicitly linked for 3rd party libs) and "libstdc+
+.so.6" (from the complier we are using).

Is it fine to use 2 different libstdc++ in same application?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]