업무/etc
[Linux] A compiler with support for C++17 language features is required. 에러 발생시 조치방법
sysops
2021. 11. 24. 15:13
728x90
Centos 7환경에서 pdns 컴파일 중 에러가 발생했다.
[root@sysops pdns-4.5.2]# ./configure
checking whether g++ supports C++17 features with -std=c++17... no
checking whether g++ supports C++17 features with +std=c++17... no
checking whether g++ supports C++17 features with -h std=c++17... no
checking whether g++ supports C++17 features with -std=c++1z... no
checking whether g++ supports C++17 features with +std=c++1z... no
checking whether g++ supports C++17 features with -h std=c++1z... no
configure: error: *** A compiler with support for C++17 language features is required.
해결방법으론 gcc-c++ 패키지를 설치해준다.
[root@sysops pdns-4.5.2]# yum install gcc-c++
만약 이미 설치되어있으나 gcc 버전이 낮다면 devtoolset-8 등을 설치해준다.
yum install centos-release-scl
yum-config-manager --enable rhel-server-rhscl-7-rpms
yum install devtoolset-8
scl enable devtoolset-8 bash
작동 확인
[root@sysops pdns-4.5.2]# ./configure
checking whether the g++ -std=c++17 linker (/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ -std=c++17 option to produce PIC... -fPIC -DPIC
checking if g++ -std=c++17 PIC flag -fPIC -DPIC works... yes
checking if g++ -std=c++17 static flag -static works... no
checking if g++ -std=c++17 supports -c -o file.o... yes
checking if g++ -std=c++17 supports -c -o file.o... (cached) yes
checking whether the g++ -std=c++17 linker (/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld -m elf_x86_64) supports shared libraries... yes728x90