LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-30-2010, 05:29 AM   #1
Semo
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Rep: Reputation: 0
libstdc++ depencie problem


Hello, I have developed and build a complex programm on an ubuntu machine. Now I want to run this program on a other distro.
After execcuting it craches immidatly and ldd shows me something like
Code:
[...]libstdc++.so.6: version 'GLIBCXX_3.4.11' not found [...]
After some searching I found out, that this means: the distro of the box I want to run the programm on has a too low libstdc++ version.

So my question is:
How can I write/compile my programm so it doas not depends that hard on the library version? Is there any way I can make my progam more "portable" between different distros/std C librarys? Or is the only way to handle this problem to rebuild it on the destination box?
 
Old 07-30-2010, 07:38 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Ubuntu ( 8.10 ... 10.04 ) :
sudo apt-get install g++-4.1

And compiling your application, example :
make CC=gcc-4.1 CXX=g++-4.1
.. Then it's compiled with the older libstdc++6-4.1-dev.
..

If you have further questions, please specify :
Ubuntu version and also the target Linux <name><version>
..

Last edited by knudfl; 07-30-2010 at 07:43 AM.
 
Old 08-04-2010, 02:28 AM   #3
Semo
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Hi,
frist of all: thanks for the help.

I tryed to install the g++-4.1 and compile my application with that but this had not the wanted effect. I tryed to change the used compiler camke uses but after some time I lost my patience and downloaded and installed a minimalistic ubuntu like I had on the source system. After installing a few librarys I could run the program.

This was not the best solution but it works now.
 
Old 08-04-2010, 05:21 AM   #4
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I think the suggestion was to install GCC 4.1 on the target system.
 
  


Reply

Tags
c++, g++, libstdc++



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
Upgrade from libstd c++.so.5 to libstdc++ library libstdc++.so.6 Net3 Red Hat 2 09-02-2009 06:01 PM
warning: libstdc++.so.5 may conflict with libstdc++.so.6 sbaratam Linux - Newbie 4 05-18-2009 02:38 PM
How to find libstdc++* or compat-libstdc++-* bopedibop Linux - Newbie 2 04-29-2008 09:53 AM
Need older libraries: libstdc++-3.2.4, libstdc++-libc6.-1.so.2, & compat-2004.7.1 al_moline SUSE / openSUSE 2 10-19-2007 07:01 AM
mismatched rpm versions of libstdc++ and libstdc++-devel pcweirdo Linux - Software 8 11-29-2004 09:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:49 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
Open Source Consulting | Domain Registration