linux安装redis时,make命令报错:collect2: fatal error: cannot find ‘ld‘和In file included from adlist.c:34:0:

报错显示找不到 “ld”这个文件
whereis ld
查询一下这个文件位置
whereis ld

[root@localhost redis-5.0.8]# whereis ld
ld: /usr/bin/ld.gold /usr/bin/ld /usr/bin/ld.bfd /usr/share/man/man1/ld.1.gz

打开这个目录查看以下该"ld"文件信息

ll /usr/bin/ld*

[root@localhost bin]# ll /usr/bin/ld*
lrwxrwxrwx. 1 root root      20 11月 28 11:48 /usr/bin/ld -> /etc/alternatives/ld
-rwxr-xr-x. 1 root root 1006192 11月  1 2021 /usr/bin/ld.bfd
-rwxr-xr-x. 1 root root    5302 5月  18 2022 /usr/bin/ldd
-rwxr-xr-x. 1 root root 5354104 11月  1 2021 /usr/bin/ld.gold
-rwxr-xr-x. 1 root root   11440 11月  6 2016 /usr/bin/ldns-chaos
-rwxr-xr-x. 1 root root   11520 11月  6 2016 /usr/bin/ldns-compare-zones
-rwxr-xr-x. 1 root root   15728 11月  6 2016 /usr/bin/ldnsd
-rwxr-xr-x. 1 root root   41784 11月  6 2016 /usr/bin/ldns-dane
-rwxr-xr-x. 1 root root   41032 11月  6 2016 /usr/bin/ldns-dpa
-rwxr-xr-x. 1 root root   15720 11月  6 2016 /usr/bin/ldns-gen-zone
-rwxr-xr-x. 1 root root   11472 11月  6 2016 /usr/bin/ldns-key2ds
-rwxr-xr-x. 1 root root   24240 11月  6 2016 /usr/bin/ldns-keyfetcher
-rwxr-xr-x. 1 root root   15680 11月  6 2016 /usr/bin/ldns-keygen
-rwxr-xr-x. 1 root root   11360 11月  6 2016 /usr/bin/ldns-mx

发现当前ld是一个软连接,而且该软连接一直在闪烁

进入该软连接目录下,发现软连接失效,已不存在ld:

[root@localhost bin]# cd /etc/alternatives/
[root@localhost alternatives]# ll
总用量 0
lrwxrwxrwx. 1 root root 35 11月 29 14:54 java -> /home/install/jdk1.8.0_144/bin/java
lrwxrwxrwx. 1 root root 15 11月 29 16:35 ld -> /usr/bin/ld.bfd
 

回到上面闪烁的目录下/etc/alternatives,创建软连接 ld

[root@localhost bin]# ln -s /usr/bin/ld.bfd ld
[root@localhost bin]# ll /usr/bin/ld*

最后输入 make 

至此问题解决 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值