A compiler with support for C++11 language features is required
這個問題是需要升級gcc
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether g++ is a working C++ compiler... yes
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=gnu++11... no
checking whether g++ supports C++11 features with -std=gnu++0x... no
checking whether g++ supports C++11 features with -std=c++11... no
checking whether g++ supports C++11 features with -std=c++0x... no
checking whether g++ supports C++11 features with +std=c++11... no
configure: error: *** A compiler with support for C++11 language features is required.
Centos6.5升級gcc:
- 前往gcc官網(wǎng) 下載最新gcc,下載完成后解壓安裝包:
tar -zxcf gcc-9.2.0.tar.gz
- 獲取依賴 GMP,MPFR,MPC
cd gcc-9.2.0
#執(zhí)行
./contrib/download_prerequisites
- 安裝gcc
./configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
make && make install
查看版本信息,如果沒有更改則修改環(huán)境變量
[root@localhost bin]# gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- 添加環(huán)境變量挨务,否則gcc還是識別舊版本惩嘉。
vi /etc/profile
#添加:
...
PATH=/usr/local/bin:$PATH
...
#重啟profile
source /etc/profile
- 再次檢測版本是否變化.
#安裝成功
[root@localhost bin]# ./gcc --version
gcc (GCC) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.