unbuntu运行gcc出现collect2: fatal error: cannot find 'ld'

来源:互联网 发布:澳洲传媒硕士 知乎 编辑:程序博客网 时间:2024/05/01 18:24

今天在使用unbuntu的编译代码的时候出现了一个问题,之前编译ok的代码都编译不出来,一直报collect2: fatal error: cannot find 'ld'这个错误,百度了一大圈都没找到,然后在google上找到了解决办法,google确实比百度强大了好多啊,话不多说具体操作如下:

1.首先apt-get install binutils-gold。

2.在apt之后然后在软连接ln -s /usr/bin/ld.gold /usr/bin/x86_64-nptl-linux-gnu-ld.gold,等软连接之后再编译就OK了。

如果可以翻墙的话可以访问https://askubuntu.com/questions/798453/collect2-fatal-error-cannot-find-ld-compilation-terminated这个连接找到答案。

阅读全文
0 0