debug之ld:collect2: fatal error: cannot find 'ld' compilation terminated.

----------------------------------------
collect2: fatal error: cannot find 'ld'
compilation terminated.
----------------------------------------
1、what is ld 
GNU Binutils是一套二进制工具集,提供了一系列用来创建、管理和维护二进制目标文件的工具程序。Binutils包括以下工具:
The GNU Binutils are a collection of binary tools. The main ones are:
ld - the GNU linker.
as - the GNU assembler.
具体可以阅读这篇文章,https://www.cnblogs.com/xuxm2007/archive/2013/02/21/2920890.html
 
2、下一步编译安装Binutils(以binutils-2.28为例)
 tar -zxvf binutils-2.28.tar.gz
./configure --prefix=$HOME/relies/binutils-2.28-install
make -j4
make install
网上教程大部分都是直接修改ld文件,但是因为非管理员,无权限,所以尝试着直接将bin文件加到环境变量PATH中,成功了,个人认为这种方法比修改ld文件方便多了(对于一个还没掌握ln命令的菜我而言)

posted on 2020-08-08 22:39  Yan12345678  阅读(1743)  评论(0编辑  收藏  举报

导航