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:
- [Solved] CentOS 6 yum update Error: Cannot find a valid baseurl for repo: base
- GCC error: unrecognized command line option ‘-no-pie’
- [Solved] Error in installing docker requires: fuse overlayfs >= 0.7
- [Solved] dockerfile Build Image Error: Error: Failed to download metadata for repo ‘appstream’…
- [Solved] kubectl error: sou-bash: _get_comp_words_by_ref: command not found
- Error: XZ compression not available
- [Solved] pod CDN: trunk Repo update failed – 56 error(s):
- [Solved] docker Error response from daemon OCI runtime create failed container_linux.go380
- [Errno 14] curl#6 – “Could not resolve host: yum.dockerproject.org; Unknown error“
- How to Solve Maven Error: Return code is: 501 , ReasonPhrase:HTTPS Required.
- [Solved] Mac Install homebrew Error: error: Not a valid ref: refs/remotes/origin/master
- [Solved] FlutterIOS CDN trunk Repo update failed – 34 error(s)
- [Solved] Android Kotlin Package release Error: Lint found fatal errors while assembling a release target.
- [Solved] ERROR: You don‘t have the SNMP perl module installed.
- [Solved] MacOS Compile ffmpeg Error: ERROR: openssl not found
- How to Solve Macbookm1 pod error
- [Solved] error: Failed dependencies libcrypto.so.10()(64bit) is needed, libssl.so.10()(64bit) is needed
- [MAC] How to Solve zsh Error: command not found: umi
- Docker Build Error: Failed to get D-Bus connection: Operation not permitted [Solved]
- Error while Launching activity [How to Solve]