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

7

11

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?

Unbound answered 16/9, 2010 at 22:37 Comment(0)
A
13

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.)

Athey answered 16/9, 2010 at 22:47 Comment(0)
L
14

rpm hence the repo knows about shared library names and what provides them. So

yum install 'libstdc++.so.5'

wiil install whatever is necessary if the repo has it.

In your case it would fetch compat-libstdc++-33-3.2.3-66.i586.rpm and its 32-bit deps if you don't have them already because the binary you are trying to run is apparently 32-bit

Luxemburg answered 17/9, 2010 at 4:47 Comment(0)
A
13

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.)

Athey answered 16/9, 2010 at 22:47 Comment(0)
W
7

yum install compat-libstdc++-33 solved this for me.

Wardrobe answered 14/1, 2014 at 23:43 Comment(0)
N
3

libstdc++.so.5 is a very old version of the standard c++ library.

Do a yum search libstdc++ , you'll have to install one of the compat-libstdc++ packages.

Nimmons answered 16/9, 2010 at 22:46 Comment(0)
D
1

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.

Dinnie answered 5/1, 2017 at 14:57 Comment(0)
G
0

worked for me too on RedHat 7 : error was :

error while loading shared libraries: libstdc++.so.5: wrong ELF class: ELFCLASS32

The solution was :
yum install compat-libstdc++-33 libstdc++.so.5 -y

Giacometti answered 28/8, 2019 at 17:52 Comment(0)
C
-1

Have you checked that the package does install libstdc++.so.5 and not some other version? That's your most likely problem.

Clockmaker answered 16/9, 2010 at 22:39 Comment(1)
This does not answer the question. This should be a comment.Estimable

© 2022 - 2024 — McMap. All rights reserved.