编译命令:
gcc -static -o test test.c
出错信息:
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
原因&解决方法:
静态链接需要静态库,系统没有安装静态库导致报错。
yum install glibc-static.x86_64
编译命令:
gcc -static -o test test.c
出错信息:
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
原因&解决方法:
静态链接需要静态库,系统没有安装静态库导致报错。
yum install glibc-static.x86_64
转载于:https://www.cnblogs.com/suphgmh/p/7797653.html