On 9 Aug, 15:06, [EMAIL PROTECTED] wrote:
> We have a C++ shared library that statically links-in g++ 4.1.1 libstdc
> ++.a on Solaris 8. It is completely self-contained library; symbols
> are resolved at link-time using the -Bdirect/-Bsymbolic option.
>
> When this C++ shared library is loaded by an application (which has
> pre-loaded g++ 3.2.3 libstdc++.so), the C++ symbols from the C++
> shared library seem to get resolved to the C++ symbols from libstdc+
> +.so. Given that the C++ shared library has been compiled w/ -Bdirect/-
> Bsymbolic, this resolution seems to be unexpected. Any ideas?

You may like to check which symbols bound to which libraries by using
LD_DEBUG environment variable. The following example runs on Linux,
you may need to check Solaris ld.so man page:

[EMAIL PROTECTED] test]$ cat test.cc
#include <iostream>
int main() { std::cout << "hi\n"; }

[EMAIL PROTECTED] test]$ g++ -Wall -o test test.cc
[EMAIL PROTECTED] test]$ ./test
hi
[EMAIL PROTECTED] test]$ LD_DEBUG=bindings ./test 2>&1 | c++filt | grep cout
     10314:     binding file /usr/lib/libstdc++.so.6 [0] to /usr/lib/
libstdc++.so.6 [0]: normal symbol `std::wcout' [GLIBCXX_3.4]
     10314:     binding file /usr/lib/libstdc++.so.6 [0] to ./test [0]:
normal symbol `std::cout' [GLIBCXX_3.4]
     10314:     binding file ./test [0] to /usr/lib/libstdc++.so.6 [0]:
normal symbol `std::cout' [GLIBCXX_3.4]

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to