前言
创作开始时间:2021年7月3日08:56:55
如题,在运行./configure的时候出现了这样的错误。这里给出解决方案。
问题描述
环境:
- ubuntu 16.04
在运行:
wget -q http://pyyaml.org/download/libyaml/yaml-0.1.7.tar.gz \
&& sudo tar xvf yaml-0.1.7.tar.gz -C /usr/local \
&& cd /usr/local/yaml-0.1.7 \
&& sudo ./configure \
的时候,报错了,说是:
configure: error: C compiler cannot create executables
解决方案
1、迷茫期
拿着这个error message去查,
- configure: error: C compiler cannot create executables https://stackoverflow.com/questions/10357804/configure-error-c-compiler-cannot-create-executables
- how to fix configure: error: C compiler cannot create executables https://askubuntu.com/questions/647583/how-to-fix-configure-error-c-compiler-cannot-create-executables
完全get不到解决方案
2、找到解决方案
所以只能继续研究,发现可以查看config.log
,进去细细查看,发现有如下错误:
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
于是去查:/usr/bin/ld: cannot find crti.o: No such file or directory
找到了参考:
-
cannot find crti.o: No such file or directory https://askubuntu.com/questions/251978/cannot-find-crti-o-no-such-file-or-directory 终于找到了适合我的场景的:
-
找不到crti.o:没有这样的文件或目录 https://qastack.cn/ubuntu/251978/cannot-find-crti-o-no-such-file-or-directory 这个是SO的翻译党。。。
-
/usr/bin/ld: cannot find -l* 错误的解决方法…… https://www.huaweicloud.com/articles/7a0fa982b8037ab67800648c5beaf69a.html
-
cpp: usr/bin/ld: cannot find -l<nameOfTheLibrary> https://stackoverflow.com/questions/30600978/cpp-usr-bin-ld-cannot-find-lnameofthelibrary
-
/usr/bin/ld: cannot find -lxxx 的解决办法 https://www.cnblogs.com/zhming26/p/6164131.html
3、具体解决方案
运行:
sudo apt-get install libc6-dev
然后重新运行configure就可以了。
小结
以上。还是需要经历一些曲折的。问题不大。
创作结束时间:2021年7月3日09:19:59