A compiler with support for C++11 language features is required.

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:

  1. 前往gcc官网 下载最新gcc,下载完成后解压安装包:
tar -zxcf gcc-9.2.0.tar.gz

  1. 获取依赖 GMP,MPFR,MPC
cd gcc-9.2.0
#执行
./contrib/download_prerequisites

  1. 安装gcc
./configure -enable-checking=release -enable-languages=c,c++ -disable-multilib

make && make install

查看版本信息,如果没有更改则修改环境变量

[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.

  1. 添加环境变量,否则gcc还是识别旧版本。
vi /etc/profile
#添加:
...
PATH=/usr/local/bin:$PATH
...
#重启profile
source /etc/profile
  1. 再次检测版本是否变化.
#安装成功
[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.

参考https://www.jianshu.com/p/2a4f4fa5f6fb

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 编译gcc-4.6.3 准备 下载GCC 源码包 : gcc-4.6.3.tar.bz2 下载GCC 依赖包:...
    火星来的农民阅读 2,029评论 0 1
  • 2014-05-26 21:21:38构建Linux 编译Linux BeagleBone Black 14年即将...
    外星间谍阅读 3,530评论 0 9
  • 介绍 GCC 全称是 GNU Compiler Collection。 GCC 原本是指 C 语言的编译器,后来逐...
    juniway阅读 5,163评论 1 1
  • This chapter discusses some of the design decisions that ...
    狂风无迹阅读 1,024评论 0 0
  • 静静的发呆,只想说几个字:小时候真好。 一朵花儿刚开,别评价,让她长大,盛开。好过时记得苛刻自己,难...
    YiRen简爱伊人阅读 459评论 6 5