LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with libstdc++ versions (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-libstdc-versions-4175469089/)

PravinB 07-09-2013 11:51 PM

Problem with libstdc++ versions
 
I had written a simple "Hello World" C++ program on Fedora13 operating system, it run properly on fedora 13. But when I had tried to run same binary on Suse7.3 it gives error:

Inconsistency detected by ld.so: dynamic-link.h: 62: elf_get_dynamic_info: Assertion ! "bad dynamic tag"' failed!

After that I had compile same code on Suse7.3 and run a binary on Fedora13 then it gives error:

./a.out: symbol lookup error: ./a.out: undefined symbol: cout

This problem occurred due to libstdc++ library.

Fedora 13 have libstdc++.so.6.0.13 library.

Suse7.3 have libstdc++-3-libc6.2-2-2.10.0.so library.

How I would create a binary which works for both Suse7.3 & Fedora13?

pan64 07-10-2013 01:13 AM

I would try static linking

PravinB 07-11-2013 02:03 AM

As mention in this link
http://www.akkadia.org/drepper/no_static_linking.html

"Never use static linking"

pan64 07-11-2013 03:55 AM

You know, there are exceptions. In general static linking is not a good idea. In your specific case you may give it a chance, actually it is missing from that page: to be able to run an app on different platforms (with conflicting libstdc++ and/or libc and/or whatever) you must link that lib statically.


All times are GMT -5. The time now is 04:41 AM.