二进制编译安装/usr/bin/ld: cannot find -latomic报错排查思路

报错内容如下

/usr/bin/ld: cannot find -latomic
collect2: error: ld returned 1 exit status
make: *** [Makefile:228: redis-server] Error 1

在这里插入图片描述

排查过程

/usr/bin/ld: cannot find -latomic主要观察这句报错内容,一般出现这种报错,都是缺少了一些函式库文件导致,编译不同的软件,报错错也是都不一样的,相同的一定就是有这句话:/usr/bin/ld: cannot find

常见的报错有一下几种:
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find -lltdl
/usr/bin/ld: cannot find –lXtst
/usr/bin/ld: cannot find -latomic
其中-l后面的字符表示的是函式库文件名称,如上例的:libc.so、libltdl.so、libXtst.so、libatomic.so。
其命名规则是:lib+库名(即xxx)+.so。

解决方法如下:使用yum安装缺少的函式库即可。

yum -y install libatomic-dev

猜你喜欢

转载自blog.csdn.net/weixin_44953658/article/details/123683716
今日推荐