LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-31-2012, 09:06 AM   #1
mazel
LQ Newbie
 
Registered: Jul 2012
Posts: 12

Rep: Reputation: Disabled
Update libstdc++ library on another system


Hello all,

I have 2 drives in one PC with debian OS each. First provides wide range of tools for development and work (including make, cmake, dev IDEs, apt-get, dpkg etc.). Second one is realy limited port of the first one (without make, cmake apt-get, dpkg, IDEs, g++, gcc ... etc.) Architecture of both systems are identical (same hw .. in fact the dev system is connected to the destination machine)

Because I had to update libstdc++ on dev (first) system, due to the requirements of the application Im develooping, there is no longer possible to run the application on the second (simple linux) system.

Static linking of libraries including libstdc++ seems to be usless (already tried)..

I dont see any other way out, than update the libstdc++ on the second system ... but on this system is not anything that should make it possible (make, apt-get, dpkg, g++, gcc..)

- another think is that this action may affect another already installed applications (hope not, if it is upgrade to higher version :/)

Is it possible to workaround this somehow from the first system with the second system mounted as a drive?

Thank you for any advice ...

Last edited by mazel; 07-31-2012 at 09:27 AM.
 
Old 07-31-2012, 12:25 PM   #2
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Isn’t it possible to install both as they are named libstdc++.so.5 and libstdc++.so.6, i.e. just copy it to the other system and you have both in place?
 
Old 08-01-2012, 01:33 AM   #3
mazel
LQ Newbie
 
Registered: Jul 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
That was maybe my first quess to just copy the library and edit symlink, but unfortunatelly it seems that there are some dependencies or other libraries that has to be resolved as well... so now Im looking for any solution (Including copying files) ... only one that is comming to my mind now is use the dev system to install standard c++ library to another drive, but I think I dont have enough experiences to figure it out somehow by myself ...

Does anybody know if the --prefix parameter of configure might help somehow (when building it from scratch)?
Because I think, that when I run make install ... then I think it installs all libraries to their default locations, or not ?
Is it possible to modify target locations for make install?
 
Old 08-01-2012, 02:29 AM   #4
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
You can have both installed with different versions. Just leave leave the name it is. The symlink from libstdc++.so to a version with a number is only necessary if you want to compile something new (at least this is the idea behind it). In the applications the name of the final target (called soname) incl. the major version number will be recorded and this way it always finds the correct version it needs even if the minor version changes.

Look for soname in this document.
 
Old 08-01-2012, 04:58 AM   #5
mazel
LQ Newbie
 
Registered: Jul 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Just tried to copy libstdc++.so.6.0.17 to /usr/lib then I ran ldconfig and symlink target was libstdc++.so.6.0.17 ...
so I tried to run the app and:

./TheApp: symbol lookup error: /lib/libstdc++.so.6: undefined symbol: _ZNSt8messagesIcE2idE, version GLIBCXX_3.4

then i executed: ldd -r /usr/lib/libstdc++.so.6

linux-gate.so.1 => (0xb8029000)
libm.so.6 => /lib/i686/cmov/libm.so6 (0xb7f10000)
libc.so.6 => /lib/i686/cmov/libc.so6 (0xb7db5000)
/lib/ld-linux.so.2 (0xb802a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7da7000)

any idea?
I tried to google the _ZNSt8messagesIcE2idE ... there are some mailing lists ... but im unable to find the solution there ...
 
Old 08-01-2012, 05:44 AM   #6
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
What do your symlinks now look like? This libstdc++.so.6.0.17 and created a symlink from libstdc++.so.6 thereto? The original libraries are still in place?
 
Old 08-01-2012, 05:56 AM   #7
mazel
LQ Newbie
 
Registered: Jul 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
/usr/lib# ls -la libstdc++*
libstdc++.so.6 -> libstdc++.so.6.0.17
libstdc++.so.6.10
libstdc++.so.6.0.17

seems that symlink is ok ... it points to ver. 17 ... and also the output was changed ... because when i tried to run the app without libstdc++.so.6.0.17 on place (and ldconfig)
the output was :

./TheApp: /usr/lib/libstdc++.so.6 version 'GLIBCXX_3.4.14' not found (required by ./TheApp)
./TheApp: /usr/lib/libstdc++.so.6 version 'GLIBCXX_3.4.15' not found (required by ./TheApp)

Last edited by mazel; 08-01-2012 at 05:58 AM.
 
Old 08-01-2012, 06:27 AM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
try this on both computers:

Code:
nm -D /usr/lib/libstdc++.so.6 | grep _ZNSt8messagesIcE2id
 
Old 08-01-2012, 07:18 AM   #9
mazel
LQ Newbie
 
Registered: Jul 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
dev system:
000ec1e0 u _ZNS8messagesIcE2idE

embeded system was not possible to run eg. nm command not found but i tried it from the dev system with modified path to libstdc++.so.6 (path to file on embeded system) and the output was the same: 000ec1e0 u _ZNS8messagesIcE2idE

Ive just realized, that I compiled the app with debug symbols (Debug profile) ... so i have to compile release version ... Im feeling that this might be the isuue
EDIT: No I have build and tried it with release version and the result was the same ...

Last edited by mazel; 08-01-2012 at 07:44 AM.
 
Old 08-01-2012, 02:43 PM   #10
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
ibstdc++.so.6.10 should be more recent than ibstdc++.so.6.0.17, but the second was installed as an update on your development system?
 
Old 08-02-2012, 01:44 AM   #11
mazel
LQ Newbie
 
Registered: Jul 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
yes, libstdc++.so.6.0.10 was the original version and then I had to update GCC on the dev system... so after that the version on the dev system is libstdc++.so.6.0.17
I tried to install yesterday the dev pkg of GCC 4.6 on the dev system and libstdc++.so.6.0.14 appeared so I compiled the app using g++-4.6 ... copied the libstdc++.so.6.0.14 to embeded system and tried to run the app ... but "ELF file OS ABI invalid" error appeared .... so Im not sure now if it is some move forward or not ...

Thank you very much for helping me out ...

I will be thankfull for any advice ...
 
Old 08-02-2012, 02:21 AM   #12
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
I think it means that libsdtc++ doesn't follow the standard, meaning version 6.0.17 isn't binary compatible with 6.0.10. (Also 6.0.10 isn't compatible with 6.0.17, but that's acceptable
But, just to be sure, install 'nm' on the other system, and repeat these steps:

Code:
nm -D /usr/lib/libstdc++.so.6.0.10 | grep _ZNSt8messagesIcE2id
nm -D /usr/lib/libstdc++.so.6.0.17 | grep _ZNSt8messagesIcE2id
ls -l /usr/lib/libstdc++.so.6
If the symbol is present in 6.0.10, but missing from 6.0.17 then the we are right, otherwise we have misunderstood something.
 
Old 08-02-2012, 04:15 AM   #13
mazel
LQ Newbie
 
Registered: Jul 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by NevemTeve View Post
I think it means that libsdtc++ doesn't follow the standard, meaning version 6.0.17 isn't binary compatible with 6.0.10. (Also 6.0.10 isn't compatible with 6.0.17, but that's acceptable
But, just to be sure, install 'nm' on the other system, and repeat these steps:

Code:
nm -D /usr/lib/libstdc++.so.6.0.10 | grep _ZNSt8messagesIcE2id
nm -D /usr/lib/libstdc++.so.6.0.17 | grep _ZNSt8messagesIcE2id
ls -l /usr/lib/libstdc++.so.6
If the symbol is present in 6.0.10, but missing from 6.0.17 then the we are right, otherwise we have misunderstood something.
Realy would like to do that ... but since there is no make, cc etc on embeded system I cant configure/ make / make install on embeded system binutils ... and if I copy the nm from dev system it requires other libraries ... one of them is libc.so.6 (glibcxx ....11) and it of course reboot imediatelly when I try to replace it ...

It is complicated ... the embeded system is quite obsolete (and any mandatory change is forbiden) and i have to run there aplication which has to support openssl 1.0 libxml2 further more in the app are included libraries which was compiled in gcc 4.5.1 and provider of these libraries claims that the whole app has to be compiled under gcc 4.5.1 ... but Im compiling it under 4.7 (and it works on dev system) ... so ... kind of problem that now I have a doubts if it is even posible...

Last edited by mazel; 08-02-2012 at 04:17 AM.
 
Old 08-02-2012, 04:25 AM   #14
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Aren't the embedded system's partitions mounted somewhere in the development system?
 
Old 08-02-2012, 04:32 AM   #15
mazel
LQ Newbie
 
Registered: Jul 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by NevemTeve View Post
Aren't the embedded system's partitions mounted somewhere in the development system?
yes, it is ... mounted in dev system /mnt/sda1/

This issue was raised when I had to install openssl 1.0 (0.9.8 was initialy on the both systems) and thus I had to upgrade gcc and other libraries (dependencies) to be able install v 1.0.0 ...

Last edited by mazel; 08-02-2012 at 04:34 AM.
 
  


Reply



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
hii,,,how to get libstdc++.so.5 library file? and how to install this in RHEL5 rambabu.linux Linux - Hardware 3 02-24-2011 10:47 AM
Upgrade from libstd c++.so.5 to libstdc++ library libstdc++.so.6 Net3 Red Hat 2 09-02-2009 06:01 PM
Can not find Library libstdc++.so.6(GLIBCXX_3.4) cector Linux - Software 2 11-01-2007 07:04 AM
Where can I find this library 'libstdc++.so.5' for fordea 4? yinglcs Linux - General 2 02-19-2006 01:23 PM
Missing the libstdc++-libc6.1.-1.so.2 library-- AAGH mst3kman Linux - Newbie 3 01-03-2006 04:50 PM

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

All times are GMT -5. The time now is 09:09 PM.

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