0

When I compile my program with the command

gcc -o ****** -Xlinker -Bstatic -L/usr/lib -lf2c -lm

an error occurs

usr/bin/ld: cannot find -lgcc_s

Who can tell me the way to solve this error? The version of my system is 32bit Ubuntu 13.04, gcc 4.6. And I had searched the error,somebody said it maybe the error of symlink, but it has the link of /usr/lib/libgcc_s.so to /lib/i386-linux-gnu/libgcc_s.so.1 on my system. I also setted system variable LD_LIBRARY_PATH=/lib/i386-linux-gnu, but it did not work.

Joe Kennedy
  • 9,365
  • 7
  • 41
  • 55
  • Does that originate in a library requested by `f2c`? Try locating libf2c, and do a `ldd libf2c.so` to check. – jcoppens May 19 '15 at 14:27

1 Answers1

0

It is happening when I add -Bdynamic to the command,gcc compile successfully.The commands of compiling program with archive library and dynamic library are different.Maybe it is the explanation of "cannot find -lgcc_s"