Cannot find -lgcc -s while Compiling C program with GCC
I am trying to compile a C program with gcc using the below command
gcc -r client.c -o exe
But getting these errors, and no generation of exe file:
/usr/bin/ld cannot find -lgcc -s
collect2: ld returned 1 exit status
An开发者_JAVA百科yone tell me what I am missing and what is ld here?
ld
is the linker or link editor. It is invoked by gcc
to link the .o
files produced by compiling your code together with various libraries (including libgcc
) to produce an executable (exe
).
Why are you passing -r
to gcc? Do you know what it does? Don't do that.
精彩评论