【解决】usrbinld: cannot find -lc

it2025-08-23  3

现象:运行gcc静态编译程序时报错:

/usr/bin/ld: cannot find -lc

collect2: ld returned 1 exit status make: *** [gcc_dry2] Error 1

(或者调用Makefile编译时报错)

原因:程序链接须要静态库,系统没有安装静态库导致报错

解决:安装静态库

#sudo  yum install glibc-static

转载于:https://www.cnblogs.com/bhlsheji/p/4383297.html

相关资源:Linux编译静态链接出现:/usr/bin/ld: cannot find -lc,解决方式
最新回复(0)