升级GCC,支持C++17

少年意气强不羁,虎胁插翼白日飞。这篇文章主要讲述升级GCC,支持C++17相关的知识,希望能为你提供帮助。
安装geany出现错误```configure: error: *** A compiler with support for C++17 language features is required```,由于编译器gcc版本过低,需要升级gcc编辑器。
1、下载GCC-11.2.0

```
]#wget https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz

直接编译会出现缺少依赖库,GMP 4.2+, MPFR2.4.0+ and MPC0.8.0+ 需 要下载依赖库。注意安装顺序,GMP是基础,MPC依赖MPFR
2、下载GMP并解压安装
```
]#wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz
]#lzip -dv gmp-6.2.1.tar.lz
]#tar -xvf gmp-6.2.1.tar
/gmp-6.2.1]#./configure
/gmp-6.2.1]#make
/gmp-6.2.1]#make install

3、下载MPFR并解压安装
```
]#wget https://www.mpfr.org/mpfr-current/mpfr-4.1.0.tar.xz
]#tar -xJf mpfr-4.1.0.tar.xz
/mpfr-4.1.0]#./configure
/mpfr-4.1.0]#make
/mpfr-4.1.0]#make install

4、下载MPC并解压安装
```
]#wget https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz
]#tar -xzf mpc-1.2.1.tar.gz
/mpc-1.2.1]#./configure
/mpc-1.2.1]#make
/mpc-1.2.1]#make install

重新再编译出现问题:required isl version is 0.15 or later,需要再安装isl
5、下载isl解压并安装
```
]#wget ftp://gcc.gnu.org/pub/gcc/infrastructure/isl.0.24.tar.bz2
]#tar -xjf isl-0.18.tar.bz2
/isl-0.18]#./configure
/isl-0.18]#make
/isl-0.18]#make install

再次错误:
*** This configuration is not supported in the following subdirectories:
gnattools gotools target-libada target-libhsail-rt target-libphobos target-zlib target-libgo target-libffi target-liboffloadmic
(Any other directories should still work fine.)
checking for default BUILD_CONFIG... bootstrap-debug

由于系统没有安装32位开发支持库,安装glibc-devel.i686
]#yum install glibc-devel.i686

【升级GCC,支持C++17】6、重新汇编GCC正常,测试版本已升级。

    推荐阅读