700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 关于gcc -m32 -o 编译错误: /usr/bin/ld: cannot find -lgcc

关于gcc -m32 -o 编译错误: /usr/bin/ld: cannot find -lgcc

时间:2022-06-20 09:26:14

相关推荐

关于gcc -m32 -o 编译错误: /usr/bin/ld: cannot find -lgcc

看了网上的总结

三种情形:

1 系统没有安装相对应的lib

2 相对应的lib版本不对

3 lib(.so档)的symbolic link 不正确,没有连结到正确的函式库文件(.so)

看了网上很多教程,关于.o文件链接的不是太懂。所以没弄成。

感觉是我遇到的是第一种情况,所以就试着安装库

sudo apt-get updatesudo apt-get purge libc6-devsudo apt-get install libc6-devsudo apt-get install libc6-dev-i386

安装时出现依赖关系错误(depend)

cd /etc/apt/ source.list

尝试了很多办法,最后发现更新一下来源(source.list)可以解决很多问题

但是改变这个一定要备份,我的Ubuntu版本是16.04LTS,使用了一个别人提供的官方文件:

#deb cdrom:[Ubuntu 16.04.1 LTS _Xenial Xerus_ - Release amd64 (0719)]/ xenial main restricted# See /community/UpgradeNotes for how to upgrade to# newer versions of the distribution.deb http://cn./ubuntu/ xenial main restricted# deb-src http://cn./ubuntu/ xenial main restricted## Major bug fix updates produced after the final release of the## distribution.deb http://cn./ubuntu/ xenial-updates main restricted# deb-src http://cn./ubuntu/ xenial-updates main restricted## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team, and may not be under a free licence. Please satisfy yourself as to## your rights to use the software. Also, please note that software in## universe WILL NOT receive any review or updates from the Ubuntu security## team.deb http://cn./ubuntu/ xenial universe# deb-src http://cn./ubuntu/ xenial universedeb http://cn./ubuntu/ xenial-updates universe# deb-src http://cn./ubuntu/ xenial-updates universe

更新source.list之后,再安装库,一切问题都解决了

sudo apt-get updatesudo apt-get purge libc6-devsudo apt-get install libc6-devsudo apt-get install libc6-dev-i386

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。