LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-17-2006, 03:36 PM   #1
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Rep: Reputation: 15
GCC compile error:cannot find -lgcc_s


command gcc -v -Wall try.c -o try


/i486-linux-gnu/4.0.4/../../.. /tmp/ccYq0fWM.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/local/bin/../lib/gcc/i486-linux-gnu/4.0.4/64/crtend.o /usr/local/bin/../lib/gcc/i486-linux-gnu/4.0.4/../../../crtn.o

/usr/local/bin/ld: cannot find -lgcc_s


what library am I missing for ld to cause the error.

thanks
 
Old 08-17-2006, 04:16 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
I've never heard of that library, to be honest. Does it compile without
a reference to it?
[edit]
Ok, I just checked on my wives 64-bit Ubuntu rig. It DOES
exist there :} ... what does locate gcc_s give you? Maybe you'll
need to add the path to it with an extra -L/path/to/it option
[/edit]


Cheers,
Tink

Last edited by Tinkster; 08-17-2006 at 04:19 PM.
 
Old 08-17-2006, 05:30 PM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 69
Here is the packages in Debian that contain the file string perhaps they are named similar in your distro, I'd say your looking for the libgcc1 one myself.

Code:
>$ afs gcc_s
gcc-3.3: usr/lib/gcc-lib/x86_64-linux-gnu/3.3.6/libgcc_s.so
gcc-3.4: usr/lib/gcc/x86_64-linux-gnu/3.4.6/32/libgcc_s.so
gcc-3.4: usr/lib/gcc/x86_64-linux-gnu/3.4.6/32/libgcc_s_32.so
gcc-3.4: usr/lib/gcc/x86_64-linux-gnu/3.4.6/libgcc_s.so
gcc-3.4: usr/lib/gcc/x86_64-linux-gnu/3.4.6/libgcc_s_32.so
gcc-4.0: usr/lib/gcc/x86_64-linux-gnu/4.0.4/32/libgcc_s.so
gcc-4.0: usr/lib/gcc/x86_64-linux-gnu/4.0.4/32/libgcc_s_32.so
gcc-4.0: usr/lib/gcc/x86_64-linux-gnu/4.0.4/libgcc_s.so
gcc-4.0: usr/lib/gcc/x86_64-linux-gnu/4.0.4/libgcc_s_32.so
gcc-4.1: usr/lib/gcc/x86_64-linux-gnu/4.1.2/32/libgcc_s.so
gcc-4.1: usr/lib/gcc/x86_64-linux-gnu/4.1.2/32/libgcc_s_32.so
gcc-4.1: usr/lib/gcc/x86_64-linux-gnu/4.1.2/libgcc_s.so
gcc-4.1: usr/lib/gcc/x86_64-linux-gnu/4.1.2/libgcc_s_32.so
lib32gcc1: emul/ia32-linux/usr/lib/libgcc_s.so.1
libgcc1: lib/libgcc_s.so.1
 
Old 08-17-2006, 06:45 PM   #4
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
GCC Linker problem: can't reference printf function

test.o: In function `mvc_marchLA':
test.c.text+0xa9c): undefined reference to `printf'
test.c.text+0xaf1): undefined reference to `printf'
test.c.text+0xbd2): undefined reference to `printf'
test.c.text+0xc31): undefined reference to `printf'


the test.c code has #inculde<stdio.h> which contains the printf prototype
why when compile& linking still generate an error that printf is an undedefined reference.

thanks
 
Old 08-17-2006, 07:19 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
I have merged your two threads because I think they're
very closely related.


Cheers,
Tink
 
Old 08-18-2006, 06:53 PM   #6
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
thanks
download the libgcc_s.so.1 and into /usr/local/lib
create a symbolic link libgcc_s.so. Now everything is OK.


anyone can help on printf function. I still stuck on that.

B/R
 
  


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
gcc compile error? wampire Programming 3 05-06-2006 09:05 PM
Strange GCC compile error with C code exvor Programming 16 08-23-2005 07:05 PM
compile GCC 4.0 error! ayiiq180 Linux - Software 3 04-22-2005 05:04 PM
compile error with gcc 3.3.2 on Mandrake 10 nboul Linux - Software 0 09-26-2004 07:53 PM
gcc-2.3.2 compile error rimo Linux From Scratch 33 07-30-2003 08:55 AM


All times are GMT -5. The time now is 02:58 PM.

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