LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-10-2013, 12:51 AM   #1
PravinB
LQ Newbie
 
Registered: Jul 2013
Posts: 2

Rep: Reputation: Disabled
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?
 
Old 07-10-2013, 02:13 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,133

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
I would try static linking
 
1 members found this post helpful.
Old 07-11-2013, 03:03 AM   #3
PravinB
LQ Newbie
 
Registered: Jul 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
As mention in this link
http://www.akkadia.org/drepper/no_static_linking.html

"Never use static linking"
 
Old 07-11-2013, 04:55 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,133

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] where to get compat-libstdc++-33 and libstdc++.so.5 files for Symantec Backup Agent ? albertwt Linux - Newbie 4 09-09-2010 10:02 AM
Strange linking errors, libstdc++ versions, libs not found? threepointonefour Programming 3 10-30-2009 12:36 PM
Need older libraries: libstdc++-3.2.4, libstdc++-libc6.-1.so.2, & compat-2004.7.1 al_moline SUSE / openSUSE 2 10-19-2007 08:01 AM
Problems with libstdc versions 5 and 6 mainemike Linux - Software 1 05-03-2006 09:42 AM
mismatched rpm versions of libstdc++ and libstdc++-devel pcweirdo Linux - Software 8 11-29-2004 10:30 AM


All times are GMT -5. The time now is 07:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration