Fatal error: stdatomic. H: no such file or directory
Under Linux, errors are reported when compiling the source code using gcc
fatal error: stdatomic.h: No such file or directory
#include <stdatomic.h>
^
compilation terminated.
The reason is that the version of GCC 4.8 is too low and requires a higher version of GCC. How to safely upgrade the GCC version?
The devtoolset package can be installed through CentOS release SCL source
yum install centos-release-scl
yum install devtoolset-8
Or add your own source to install it (I’ll take centos7 as an example)
vi /etc/yum.repos.d/CentOS-SCLo-scl.repo
[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/rh/
#mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
Activate the GCC version to make it effective
scl enable devtoolset-8 bash
or
source /opt/rh/devtoolset-8/enable
At this time, you can see through the GCC — version command that the GCC version has changed to 8.X.x. it is worth noting that this only takes effect in the current bash. If it needs to take effect permanently, you can add environment variables yourself.
Read More:
- Grpc Compilation issues: “C++ versions less than C++11 are not supported.
- How to Solve Error: EOF occurred in violation of protocol (_ssl.c:877)
- Windows: How to Solve PCL C2065 Error
- How to Solve error C2039: “to_ String “: not a member of” STD “
- [Solved] fatal error C1189: #error: STL1003: Unexpected compiler, expected C++ compiler
- How to Solve error: command ‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe‘ failed
- [Solved] Fatal error C1083: unable to open include file: ‘d3dx9.h’
- C++: fatal error: variant: No such file or directory
- [Solved] utils.c:33:18: fatal error: zlib.h: No such file or directory
- How to Fix “Microsoft Visual C ++ 14.0 is required” Error
- How to Solve Nginx cross compilation Error
- [Solved] Software Compile Error: xdo.c:29:34: fatal error: X11/extensions/XTest.h:
- Cannot start container 39f96c64a9c6: [8] System error: exec format error
- [Solved] URIError: Failed to decode param ‘/%3C%=%20BASE_URL%20%3Estatic/index.%3C%=%20VUE_APP_INDEX_CSS_HASH%20%3E.css’
- C++:error C2872: ‘byte‘: ambiguous symbol [How to Solve]
- [Solved] fatal error C1083: Could Not Open Unable to open include file:“stdint.h”: No such file or directory
- [Solved] fatal error C1083: Cannot open included files: “stdafx.h”: No such file or directory
- [Solved] Linux R Pack Error: cram/cram_io.c:61:10: fatal error: lzma.h: No such file or directory
- bazel Compile Error: absl/base/policy_checks.h:79:2: error: #error “C++ versions less than C++14 are not supported.”