C/C++编程:fatal error: stdatomic.h: 没有那个文件或目录
使用gcc编译软件时,出现错误
fatal error: stdatomic.h: 没有那个文件或目录
#include <stdatomic.h>
^
compilation terminated.
gcc 4.8 的漏洞,在gcc 4.9已经修复
解决方法:
安装更高版本的gcc
例如:
sudo apt-get install gcc-4.9
centos下:
wget https://copr.fedoraproject.org/coprs/hhorak/devtoolset-4-rebuild-bootstrap/repo/epel-7/hhorak-devtoolset-4-rebuild-bootstrap-epel-7.repo -O /etc/yum.repos.d/devtools-4.repo
yum install devtoolset-4-gcc devtoolset-4-binutils devtoolset-4-gcc-c++
scl enable devtoolset-4 bash
ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r
gcc --version
还没有评论,来说两句吧...