简体   繁体   English

使用gcc和autoconf链接程序时出现“找不到-lc”错误

[英]'Cannot find -lc' error when linking a program using gcc and autoconf

I'm trying to compile a program written in C. ./configure was successful, but when I did make , it gave me an error. 我正在尝试编译用./configure编写的程序成功,但是当我执行make ,它给了我一个错误。 I did make check , and it said: 我确实make check ,并说:

gcc  -g -Wall -static   -o multipht  multipht.o multimatch.o multiweight.o multiwrite.o multisort.o multiclean.o
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

("multipht" is the name of the program I'm trying to install.) (“ multipht”是我要安装的程序的名称。)

Could anyone tell me what the problem is? 谁能告诉我问题是什么?

Your system appears to not have a statically linkable C library. 您的系统似乎没有可静态链接的C库。 That's actually pretty common these days. 这些天实际上很普遍。 Take off the -static flag and you should be good to go. 脱掉-static标志,您应该一切顺利。

在Fedora上,glibc的静态版本位于glibc-static软件包中。

sudo yum -y install glibc-devel glibc-static

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM