Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to compile symlinks (tar.gz-file), which is a very small tool with one line for compilation:

gcc -Wall -Wstrict-prototypes  -O2 -N -s -o symlinks symlinks.c

which gives the error

/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status

The output of

/sbin/ldconfig -p | grep libgcc

is (libc6) => /lib/i386-linux-gnu/

and trying to include the mentioned directory directly

gcc -Wall -Wstrict-prototypes -L /lib/i386-linux-gnu/  -O2 -N -s -o symlinks symlinks.c

produces the same error.

Three questions:

  1. Why does it not work with the first command, as the lib seems to be in the search path
  2. Why does including the path itself does not help
  3. How to fix this?
share|improve this question
Since you are passing the -static-libgcc flag, shouldn't you be looking for libgcc_s.a rather than – steeldriver Nov 13 '13 at 15:39
Sorry, the original command (from Makefile) is as above, without --static-libgcc. – Alex Nov 13 '13 at 16:18

Solution: Omitting the option -N.

share|improve this answer
Please explain why this will solve the problem. – chaskes Nov 13 '13 at 16:59
This is a low quality answer. Please edit to explain how this will work. – Tim Jan 9 '15 at 22:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.