LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-30-2006, 05:58 AM   #1
Crog
LQ Newbie
 
Registered: May 2006
Location: Southern California
Distribution: openSuSE 10.1
Posts: 24

Rep: Reputation: 15
libgcc_s.so.1: version 'GCC_3.3' not found...


So this is the error I'm getting when trying to run MySQL, YaST and who knows what other programs.

It all began earlier yesterday when I decided to experiment with my own little webserver and see if it can handle hosting games such as Call of Duty 2 multiplayer. I try to install CoD2, get an error, follow the guide (http://www.callofduty.com/patch/README.txt) and download the needed library (http://icculus.org/updates/cod/gcc3-libs.tar.bz2), then (stupidly) unpacked it into the /lib directory...the install then continued to proceed nicely and I was hosting a game in no time.

I shutdown my server for a moment, then restarted it. I didn't have a monitor hooked up to it at the time, so I couldn't view the boot-up progress (therefore not being able to know what was loading successfully and what wasn't). I gave it a few minutes before I logged in remotely using PuTTY. At first I realised that I was getting a database error when trying to view my forum.

In PuTTY, I type in

Code:
www:~ # /etc/init.d/mysql restart
it shuts down fine, but fails to start. When I try to log in mysql, it says the following:

Code:
www:~ # mysql
mysql: /lib/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/lib/libstdc++.so.6)
YaST yields the following:

Code:
www:~ # yast
/usr/lib/YaST2/bin/y2base: /lib/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/YaST2/plugin/libpy2ncurses.so.2: /lib/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/YaST2/bin/y2base: /lib/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/lib/libstdc++.so.6)
So, how do I go about reversing the damage done? I don't even know where to begin.
 
Old 06-30-2006, 05:18 PM   #2
Crog
LQ Newbie
 
Registered: May 2006
Location: Southern California
Distribution: openSuSE 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
Argh, I've been struggling with this problem for hours and hours already. Can someone at least point me in a direction I should go? ANYTHING would be helpful, as this is very new territory for me. I did tons of search engine queries only to find nothing really helpful
 
Old 06-30-2006, 05:58 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
My guess is that when you unpacked the tarball into the /lib directory, that you overwrote some libraries. Even if they are the same files, this may have broken symbolic links.

Make a long listing of your /lib directory. Make a note of which libraries are dated when installed the game. Also make a note of similarly named broken links.

So libgcc_s.so.1 might be a symbolic link to libgcc_s.so, which is broken because libgcc_s.so that was present was overwritten by libgcc_s.so from the tarball. If this is the case, create your own symbolic link and see if you can use yast then.

If that doesn't work, and the rpm command is still functional, you could try the command: "rpm -q -f /lib/libgcc_s.so.1" to find out which package supplies the file.

Last edited by jschiwal; 06-30-2006 at 06:10 PM.
 
Old 06-30-2006, 06:58 PM   #4
Crog
LQ Newbie
 
Registered: May 2006
Location: Southern California
Distribution: openSuSE 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
Thanks for some advice...

First off, the tarball (that helped run the game) contains the following:

libgcc_s.so
libgcc_s.so.1
libstdc++.so
libstdc++.so.5
libstdc++.so.5.0.3

The errors that I mentioned earlier seem to be caused by the programs' need for libstdc++.so.6 (which seems to be intact in /usr/lib...all I see in /lib are references to libstdc++.so.5 and libstdc++.so.5.0.3). Not sure if all this means anything.

Also, how would I go about creating a symbolic link to the original libgcc_s.so if it's been overwritten? When I try to unpack an rpm file with what I think is the original...it says that the package is already installed, when I try to delete it (rpm -e libgcc-4.1.0-25.i586.rpm), it then says "error: package libgcc-4.1.0-25.i586.rpm is not installed".

The output to rpm -q -f /lib/libgcc_s.so.1 is:

Code:
www:/lib # rpm -q -f /lib/libgcc_s.so.1
libgcc-4.1.0-25
 
Old 06-30-2006, 07:42 PM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I'm back on my linux system, so I can look at things on my system. It is an Amd64 system running SuSE 10.1, so it has both 32 and 64 bit libraries.
Code:
jschiwal@hpamd64:/lib> ls /lib/libgcc*
/lib/libgcc_s.so.1
jschiwal@hpamd64:/lib> rpm -qf /lib/libgcc_s.so.1
libgcc-4.1.0-25
jschiwal@hpamd64:/lib> rpm -ql libgcc
/lib/libgcc_s.so.1
/lib64/libgcc_s.so.1
jschiwal@hpamd64:/lib> rpm -q --info libgcc
Name        : libgcc                       Relocations: (not relocatable)
Version     : 4.1.0                             Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release     : 25                            Build Date: Fri 28 Apr 2006 05:25:09 PM CDT
Install Date: Sun 21 May 2006 07:14:48 AM CDT      Build Host: gershwin.suse.de
Group       : System/Base                   Source RPM: gcc-4.1.0-25.src.rpm
Size        : 97700                            License: GPL
Signature   : DSA/SHA1, Fri 28 Apr 2006 05:33:55 PM CDT, Key ID a84edae89c800aca
Packager    : http://bugs.opensuse.org
URL         : http://gcc.gnu.org/
Summary     : C compiler runtime library
Description :
Libgcc is needed for dynamically linked C programs.



Authors:
--------
    The GCC team.
Distribution: SUSE LINUX 10.1 (X86-64)
The libgcc package only supplies the single library file: libgcc_s.so.1 on my system. There are no links. On my system there also is a 64 bit version of the same library.

You might try as root: "rpm -I --replace-files libgcc". The command "rpm -F --replace-files libgcc" may also work.
If that doesn't replace the libgcc_c.so.1 file with the original, then you could try using the "mc" midnight commander program. It is able to browse rpm files and copy individual files from them.
There is also the "unrpm" command that extracts everything in an rpm package. It is best to copy the rpm to a temporary directory first. It is also possible to use "rpm2cpio" and then cpio to extract files also. These are manual methods of doing some of the things that yast and the rpm commands do in the background when things are working.

Here is a long listing from my /usr/lib/ directory:
Code:
jschiwal@hpamd64:/usr/lib> ls -l libstdc++*
-rwxr-xr-x 1 root root  358388 2006-04-22 20:44 libstdc++-3-libc6.1-2-2.10.0.so
-rwxr-xr-x 1 root root  379394 2006-04-22 20:44 libstdc++-3-libc6.2-2-2.10.0.so
-rw-r--r-- 1 root root 1954552 2006-04-28 17:21 libstdc++.a
-rw-r--r-- 1 root root     791 2006-04-28 17:22 libstdc++.la
-rwxr-xr-x 1 root root  358509 2006-04-22 20:44 libstdc++-libc6.1-1.so.2
lrwxrwxrwx 1 root root      31 2006-05-21 07:18 libstdc++-libc6.1-2.so.3 -> libstdc++-3-libc6.1-2-2.10.0.so
lrwxrwxrwx 1 root root      31 2006-05-21 07:18 libstdc++-libc6.2-2.so.3 -> libstdc++-3-libc6.2-2-2.10.0.so
lrwxrwxrwx 1 root root      18 2006-05-21 08:58 libstdc++.so -> libstdc++.so.6.0.8
lrwxrwxrwx 1 root root      20 2006-05-21 07:18 libstdc++.so.2.7.2 -> libstdc++.so.2.7.2.8
-rwxr-xr-x 1 root root  245395 2006-04-22 20:44 libstdc++.so.2.7.2.8
lrwxrwxrwx 1 root root      18 2006-05-21 07:18 libstdc++.so.2.8 -> libstdc++.so.2.8.0
-rwxr-xr-x 1 root root  325815 2006-04-22 20:44 libstdc++.so.2.8.0
lrwxrwxrwx 1 root root      18 2006-05-21 07:18 libstdc++.so.2.9 -> libstdc++.so.2.9.0
-rwxr-xr-x 1 root root  352278 2006-04-22 20:44 libstdc++.so.2.9.0
lrwxrwxrwx 1 root root      18 2006-05-21 07:15 libstdc++.so.5 -> libstdc++.so.5.0.7
-rwxr-xr-x 1 root root  747432 2006-04-28 09:43 libstdc++.so.5.0.7
lrwxrwxrwx 1 root root      18 2006-05-21 07:15 libstdc++.so.6 -> libstdc++.so.6.0.8
-rwxr-xr-x 1 root root  895492 2006-04-28 17:22 libstdc++.so.6.0.8
I highlighted the line that I think might be important. Notice that libstdc++.so is a link to libstdc++.so.6.0.8 on my system. I think that this link may have been replaced when you installed the game server.
Use the command "ls -l /usr/lib/libstdc++.so* on your system and post the results. You may have a different .so.6 version that should be the target of the link. I guess my original description was backwards. The generic filename is the link to the particular version.

You should be able to repair the libstc++.so error by unlinking libstdc++.so and creating a new link with the "ln" command. Look at "ln --help" for instructions on the ln command. The target of the link will be determined from your long listing results.

----
ps. After editing this post, I took a closer look at the libgcc_so libraries on my system.
lrwxrwxrwx 1 root root 18 2006-05-21 08:58 /usr/lib/libgcc_s_32.so -> /lib/libgcc_s.so.1
lrwxrwxrwx 1 root root 18 2006-05-21 08:58 /usr/lib/libgcc_s.so -> /lib/libgcc_s.so.1
lrwxrwxrwx 1 root root 14 2006-05-21 01:33 /usr/lib/libgcc_s.so.1 -> libgcc_s_32.so
There is some goofiness because I am using a 64 distro. A .so.1 is a link to a .so which is a link to a .so.1!

However, I wanted to point this out, because you may have some broken links in /usr/lib/ as well.
Try looking at "ls /usr/lib/libgcc_s* -l".

Last edited by jschiwal; 06-30-2006 at 07:51 PM.
 
Old 06-30-2006, 08:48 PM   #6
Crog
LQ Newbie
 
Registered: May 2006
Location: Southern California
Distribution: openSuSE 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
Code:
www:/usr/lib # ls -l libstdc++.*
lrwxrwxrwx 1 root root     18 Jun 30 18:33 libstdc++.so -> libstdc++.so.6.0.8
lrwxrwxrwx 1 root root     18 Jun 14 14:48 libstdc++.so.6 -> libstdc++.so.6.0.8
-rwxr-xr-x 1 root root 895492 Apr 28 16:14 libstdc++.so.6.0.8
^^Bold is the link I created (still no change for the better).

Code:
www:/lib # ls /lib/libgcc*
/lib/libgcc-3.3.1-29.i586.rpm          /lib/libgcc-4.1.0-25.i586.rpm     /lib/libgcc_s.so
/lib/libgcc-4.0.2_20050901-3.i586.rpm  /lib/libgcc1-3.3.1-4sls.i586.rpm  /lib/libgcc_s.so.1
www:/lib # rpm -qf /lib/libgcc_s.so.1
libgcc-4.1.0-25
www:/lib # rpm -ql libgcc
/lib/libgcc_s.so.1
www:/lib # rpm -q --info libgcc
Name        : libgcc                       Relocations: (not relocatable)
Version     : 4.1.0                             Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release     : 25                            Build Date: Fri Apr 28 16:16:41 2006
Install Date: Wed Jun 14 16:40:33 2006      Build Host: zuse.suse.de
Group       : System/Base                   Source RPM: gcc-4.1.0-25.src.rpm
Size        : 42148                            License: GPL
Signature   : DSA/SHA1, Fri Apr 28 16:30:05 2006, Key ID a84edae89c800aca
Packager    : http://bugs.opensuse.org
URL         : http://gcc.gnu.org/
Summary     : C compiler runtime library
Description :
Libgcc is needed for dynamically linked C programs.



Authors:
--------
    The GCC team.
Distribution: SUSE LINUX 10.1 (i586)
^^Italicised rpm's are the ones I downloaded yesterday in hopes of fixing the problem, which they didn't.

Code:
www:/lib # ls -l libstdc++.so*
lrwxrwxrwx 1 500 500      18 Jun 30 18:28 libstdc++.so -> libstdc++.so.5.0.3
lrwxrwxrwx 1 500 500      18 Jun 30 18:28 libstdc++.so.5 -> libstdc++.so.5.0.3
-rwxr-xr-x 1 500 500 2886540 Nov 25  2003 libstdc++.so.5.0.3
EDIT
Here's some more:

Code:
www:~ # rpm -I --replacefiles libgcc
-I: unknown option
www:~ # rpm -F --replacefiles libgcc
error: open of libgcc failed: No such file or directory
--replace-files didn't work, so I used rpm --help to find out the correct syntax.

Last edited by Crog; 06-30-2006 at 09:02 PM.
 
Old 07-01-2006, 12:03 AM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I think that you need to include the entire filename for these RPMs.

In noticed a small descrepency:
www:/usr/lib # ls -l libstdc++.*
lrwxrwxrwx 1 root root 18 Jun 30 18:33 libstdc++.so -> libstdc++.so.6.0.8
lrwxrwxrwx 1 root root 18 Jun 14 14:48 libstdc++.so.6 -> libstdc++.so.6.0.8
-rwxr-xr-x 1 root root 895492 Apr 28 16:14 libstdc++.so.6.0.8

lrwxrwxrwx 1 500 500 18 Jun 30 18:28 libstdc++.so -> libstdc++.so.5.0.3
lrwxrwxrwx 1 500 500 18 Jun 30 18:28 libstdc++.so.5 -> libstdc++.so.5.0.3
-rwxr-xr-x 1 500 500 2886540 Nov 25 2003 libstdc++.so.5.0.3

in /usr/lib version 6.0.8 is used. In /usr version 5.0.3 is used. This doesn't sound right. It seems to me that /lib/libstdc++.so -> /lib/libstdc++.so.6.08 would be correct.

Alternately, perhaps /usr/lib/libstdc++.so -> /lib/libstdc++.so or vice versa.

I just looked where on my system I have libstdc++.so:
locate libstdc++.so
Code:
jschiwal@hpamd64:~/podcasts> locate libstdc++.so
/usr/lib/libstdc++.so
/usr/lib/libstdc++.so.2.7.2
/usr/lib/libstdc++.so.2.7.2.8
/usr/lib/libstdc++.so.2.8
/usr/lib/libstdc++.so.2.8.0
/usr/lib/libstdc++.so.2.9
/usr/lib/libstdc++.so.2.9.0
/usr/lib/libstdc++.so.5
/usr/lib/libstdc++.so.5.0.7
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.8
/usr/lib64/libstdc++.so
/usr/lib64/libstdc++.so.5
/usr/lib64/libstdc++.so.5.0.7
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.8
/usr/local/google-earth/libstdc++.so.6
I don't have any instances of /lib/libstdc++.so. The /usr/lib64/ entries are due having an AMD64 architecture.
The error messages that you posted were with loading libgcc_c.so. The libstdc++ was trying to load the library and failing. The reason we are considering that libstdc++.so might be corrupted is because it is one of the files replaced by the tarball.

Take a look at this listing:
Code:
jschiwal@hpamd64:~/podcasts> ldd /usr/lib/libstdc++.so.6
        linux-gate.so.1 =>  (0xffffe000)
        libm.so.6 => /lib/libm.so.6 (0xf7e89000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf7e7e000)
        libc.so.6 => /lib/libc.so.6 (0xf7d5e000)
        /lib/ld-linux.so.2 (0x56555000)
These are the libraries that my libstdc++.so calls.
If you believe that libgcc_s is fixed, make sure that /lib/ and /usr/lib are listed in /etc/ld.so.conf and run as root the command "ldconfig".
 
Old 07-01-2006, 01:00 AM   #8
Crog
LQ Newbie
 
Registered: May 2006
Location: Southern California
Distribution: openSuSE 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
jschiwal, I sent an email to you...check it out. Thanks.
 
Old 07-01-2006, 03:32 AM   #9
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
If you try to restart the mysql server is says that it couldn't load the /lib/libgcc_c.so.1 library. Notice the part that says "GCC_3.3".

Enter the command "strings /lib/libgcc_c.so.1".
www:/var/log # strings /lib/libgcc_s.so.1 | grep GCC
GCC_3.0

The /lib/libgcc_c.so.1 is an older version.

The version of the rpm file that supplies libgcc_s.so.1 is the same file and version as yours, however, if I enter
the same command I get:
jschiwal@hpamd64:/usr/lib> strings libgcc_s_32.so | grep GCC
GCC_3.0
GCC_3.3
GCC_3.3.1
GCC_3.4
GCC_3.4.2
GCC_4.0.0


So the applied fix is "rpm -i --force rpm -i --force -h libgcc-4.1.0-25.i586.rpm --verbose" ( the -h and --verbose are optional. )
 
Old 07-01-2006, 03:37 AM   #10
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I would also recommend disabling root login in the /etc/ssh/sshd_config configuration.
Also add your username to AllowUsers. If you want to allow someone to administor your machine remotely, temporarily change the root password with the "passwd" command and he or she can log in as a normal user.
 
Old 07-01-2006, 12:35 PM   #11
Crog
LQ Newbie
 
Registered: May 2006
Location: Southern California
Distribution: openSuSE 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
Haha, I love you man

Thank you for all your help and time, sure saved me several more hours and hours of wasted time.

Thanks for the tips too.
 
Old 07-05-2006, 01:42 AM   #12
combatbob
LQ Newbie
 
Registered: Aug 2005
Location: Killeen, Texas
Distribution: Slackware 10.1, Mandriva, Debian
Posts: 23

Rep: Reputation: 15
Libstdc++

You might find this interesting.
2.6 Why do I get an error saying libstdc++.so.X is missing when I run my program?
Depending on your platform and library version, the message might be similar to one of the following:
./a.out: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

/usr/libexec/ld-elf.so.1: Shared object "libstdc++.so.6" not found
This doesn't mean that the shared library isn't installed, only that the dynamic linker can't find it. When a dynamically-linked executable is run the linker finds and loads the required shared libraries by searching a pre-configured list of directories. If the directory where you've installed libstdc++ is not in this list then the libraries won't be found. The simplest way to fix this is to use the LD_LIBRARY_PATH environment variable, which is a colon-separated list of directories in which the linker will search for shared libraries:
LD_LIBRARY_PATH=${prefix}/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
The exact environment variable to use will depend on your platform, e.g. DYLD_LIBRARY_PATH for Darwin, LD_LIBRARY_PATH_32/LD_LIBRARY_PATH_64 for Solaris 32-/64-bit, LD_LIBRARYN32_PATH/LD_LIBRARY64_PATH for Irix N32/64-bit ABIs and SHLIB_PATH for HP-UX.
See the man pages for ld(1), ldd(1) and ldconfig(8) for more information. The dynamic linker has different names on different platforms but the man page is usually called something such as ld.so / rtld / dld.so.

Pay special attention to Second paragragh, I hope this broadens your horizen. The web page is

http://gcc.gnu.org/onlinedocs/libstd...index.html#2_6

good luck
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
/lib/libgcc_s.so.1: version `GCC_3.3.1' not found murder Linux - Software 1 01-06-2006 07:13 AM
BF2 Server `GCC_3.3' not found Zlayer Linux - Games 3 08-21-2005 12:35 PM
Need to get libgcc_s.so.1 furiousV Linux - Newbie 4 08-05-2005 08:40 AM
libgcc_s.so.1 problem Eunsuk Kang Linux - Newbie 2 09-17-2004 07:41 AM
libc.so.6 GCC_3.0 ???????????????????? Kenny81 Linux - General 0 01-26-2004 06:05 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration