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 |
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 |
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 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 |
I have merged your two threads because I think they're
very closely related. Cheers, Tink |
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. |