开发者

Cannot find -lgcc -s while Compiling C program with GCC

开发者 https://www.devze.com 2023-04-07 15:17 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号