Gcc静态编译出错

编译命令:
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

posted @ 2017-11-07 10:05  suphgmhh  阅读(369)  评论(0编辑  收藏  举报