Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libstdc++.so.5: cannot open shared object file - but library is installed and up-to-date

My client had some developer write a small c++ command-line app to run on their Linux servers. On one of the servers (running Fedora 11), when I execute the app I get the following error:

error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

Obviously the first thing I did was

yum install libstdc++

But I get

Package libstdc++-4.4.1-2.fc11.x86_64 already installed and latest version

So the library already exists and is up-to-date. Usually to me these errors indicate a missing library. So where should I look next?

like image 882
Jake Wilson Avatar asked Sep 16 '10 22:09

Jake Wilson


People also ask

How do I open a shared library file?

If you want to open a shared-library file, you would open it like any other binary file -- with a hex-editor (also called a binary-editor). There are several hex-editors in the standard repositories such as GHex (https://packages.ubuntu.com/xenial/ghex) or Bless (https://packages.ubuntu.com/xenial/bless).


2 Answers

libstdc++-4.4.1-2.fc11.x86_64 installs libstdc++.so.6. You need the compat-libstdc++-33-3.2.3-66.x86_64 package to get libstdc++.so.5. (Do not symlink! libstdc++.so.5 and libstdc++.so.6 are incompatible.)

like image 59
Ken Bloom Avatar answered Sep 27 '22 16:09

Ken Bloom


As stated by caf and aaron, running yum install compat-libstdc++-33 libstdc++.so.5 -y worked for me when I got a similar error.

The only catch I ran into was, I didn't have the correct repo checked out so I had to run yum-config-manager --enable rhel-7-server-optional-rpms to access the files. If you are using something other than RedHat 7 you will need to search for the correct repo.

You could always check if you have the correct repo by running yum provides libstdc++.so.5 first.

like image 41
RunThor Avatar answered Sep 27 '22 16:09

RunThor