在使用 gcc -static 静态链接时,出现如下错误:
/usr/bin/ld: cannot find -lc
collect2: 错误:ld 返回 1
原因分析:
可能是因为静态库没有安装,先检查有没有安装静态库:
yum list installed | grep glibc-static
如果没有安装,则安装即可:
yum install glibc-static
在使用 gcc -static 静态链接时,出现如下错误:
/usr/bin/ld: cannot find -lc
collect2: 错误:ld 返回 1
原因分析:
可能是因为静态库没有安装,先检查有没有安装静态库:
yum list installed | grep glibc-static
如果没有安装,则安装即可:
yum install glibc-static