编译redis5.0.4报错/usr/bin/ld: cannot find -latomic

报错内容如下
/usr/bin/ld: 找不到 -latomic
collect2: 错误:ld 返回 1
make[1]: *** [Makefile:228:redis-server] 错误 1
make[1]: 离开目录“/usr/local/redis-5.0.14/src”
make: *** [Makefile:6:all] 错误 2
编译redis5.0.4报错/usr/bin/ld: cannot find -latomic_第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  或者 yum -y install libatomic-dev

你可能感兴趣的:(arm适配,linux,centos,arm)