LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GCC compile error:cannot find -lgcc_s (https://www.linuxquestions.org/questions/linux-newbie-8/gcc-compile-error-cannot-find-lgcc_s-474862/)

lilzz 08-17-2006 02:36 PM

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

Tinkster 08-17-2006 03:16 PM

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

HappyTux 08-17-2006 04:30 PM

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


lilzz 08-17-2006 05:45 PM

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

Tinkster 08-17-2006 06:19 PM

I have merged your two threads because I think they're
very closely related.


Cheers,
Tink

lilzz 08-18-2006 05:53 PM

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


All times are GMT -5. The time now is 09:03 AM.