Link to home
Start Free TrialLog in
Avatar of Fireman54
Fireman54

asked on

libstdc++.so.5: cannot open shared object file: No such file or directory

Over the past 2 years I have had RHEL ES 3 as my operating system, and today on a leased server I got RHEL 4 instead. I'm getting the following error...
libstdc++.so.5: cannot open shared object file: No such file or directory.

I tried to locate this file but it's not on the server. The only thing that's there is
/usr/lib/libstdc++.so.6.0.3
/usr/lib/libstdc++.so.6
/usr/lib/gcc/i386-redhat-linux/3.4.3/libstdc++.so.

Is there a way to install a libstdc++.so.5 file without messing up the compiler I currently have that came with gcc 3.4.5 ? If so, what do I need to get and where can I get it ? Also, is it a big deal to install ?

Thanks,
Fireman54
Avatar of sheetbird
sheetbird

in the past I've had success in other cases with something like:

ln -s  /usr/lib/libstdc++.so.6  /usr/lib/libstdc++.so.5

However that is kind of a hack job, you could also find the older version rpm and try to install it (without removing the current libstdc++ rpm) which is the right way.  If it gives you conflicts you can just unpack it somewhere and then copy libstdc++.so.5 to /usr/lib.
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Duncan Roe
You can simply copy  /usr/lib/libstdc++.so.5.0.6 (or whatever version it is) off a RHEL ES 3 system. Then rerun ldconfig.
Or if you're not root (and don't want to take a change messing up the system --

1) copy libstdc++.so.5 to someplace safe (like /tmp/lib)
do
LD_LIBRARY_PATH=/tmp/lib:$LD_LIBRARYPATH application

see if it works first...then you might want to put it in a privaleged place
(or in ~/lib and just live with LD_LIBRARY_PATH).
I've had 3 versions of libstdc++.so co-existing in my /usr/lib for years - so I think the chances of messing up your system are minimal.
But if you can't become root then leisner has an idea. Be sure to copy the one with the longest name, then make libstdc++.so.5 a symlink to it.
Avatar of Fireman54

ASKER

I ran...   rpm -ivh compat-gcc-32-3.2.3-47.3.src.rpm and it appeared to install but libstdc++.so.5 is nowhere on the hardrive.

Please advise,
Fireman54
That is a source rpm. You would have to build it. So far you have installed the source ready for building. You might have to use rpmbuild or maybe rpm has an option to build nowadays - I don't know as I avoid rpm when I can. You already have my advice as to what I would be doing in your situation.
Duncan, aren't you saying to install it in your earlier post? I do have root access. Should I not use a source rpm?

It's not clear to me what you said about "copy the one with the longest name, then make libstdc++.so.5 a symlink to it." The longest name?

Thanks,
Duncan,

Also, when I ran    rpm -ivh compat-gcc-32-3.2.3-47.3.src.rpm   it ran real fast gas guage, but it never created a directory for it, typically like a tar would.
Ravenpl,

I ran "up2date -i compat-libstdc++-33" and it worked perfectly.

Thank you,
Fireman54