We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

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

Fireman54
Fireman54 asked
on
Medium Priority
17,180 Views
Last Modified: 2011-08-18
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
Comment
Watch Question

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.
Top Expert 2005
Commented:
> ln -s  /usr/lib/libstdc++.so.6  /usr/lib/libstdc++.so.5
don't - it's know to be incompatible
instead, download and install compat-libstdc++-33 package
if You online try: up2date compat-libstdc++-33

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Duncan RoeSoftware Developer
CERTIFIED EXPERT

Commented:
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.

Commented:
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).
Duncan RoeSoftware Developer
CERTIFIED EXPERT

Commented:
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.

Author

Commented:
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
Duncan RoeSoftware Developer
CERTIFIED EXPERT

Commented:
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.

Author

Commented:
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,

Author

Commented:
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.

Author

Commented:
Ravenpl,

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

Thank you,
Fireman54
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.