Centos 7.6 gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

复制代码
yum install -y wget lftp gcc gcc-c++ make openssl-devel pcre-devel pcre

yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm

sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-2-3.el7.centos.noarch.rpm

yum provides gcc

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* centos-sclo-rh: mirrors.bupt.edu.cn

devtoolset-7-gcc-7.1.1-2.1.el7.x86_64 : GCC version 7

Repo : centos-sclo-rh

Matched from:

Provides : gcc = 7.1.1-2.1.el7

gcc-4.8.5-44.el7.x86_64 : Various compilers (C, C++, Objective-C, Java, ...)

Repo : base

devtoolset-7-gcc-7.1.1-2.1.el7.x86_64 : GCC version 7

Repo : @centos-sclo-rh

Matched from:

Provides : gcc = 7.1.1-2.1.el7

gcc-4.8.5-44.el7.x86_64 : Various compilers (C, C++, Objective-C, Java, ...)

Repo : @base

复制代码
yum install devtoolset-7-gcc-c++ -y

source /opt/rh/devtoolset-7/enable
gcc --version
g++ --version
mv /usr/bin/gcc /usr/bin/gcc-4.8.5
ln -s /opt/rh/devtoolset-7/root/bin/gcc /usr/bin/gcc
gcc --version

gcc --version

gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

Copyright (C) 2017 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.

g++ --version

g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

Copyright (C) 2017 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.

相关推荐
励志不掉头发的内向程序员4 分钟前
STL库——string(类模拟实现)
开发语言·c++
王廷胡_白嫖帝6 分钟前
Qt文件压缩工具项目开发教程
java·开发语言·qt
张飞洪26 分钟前
C# 13 与 .NET 9 跨平台开发实战:基于.NET 9 与 EF Core 9 的现代网站与服务开发
开发语言·c#·.net
郝学胜-神的一滴32 分钟前
使用C++11改进工厂方法模式:支持运行时配置的增强实现
开发语言·c++·程序人生·设计模式
我是场38 分钟前
Android14内核调试 - boot & vendor_boot
java·开发语言·spring boot
爱和冰阔落39 分钟前
从关机小游戏学 C 语言:分支循环 + 关键字(break/continue)实战
c语言·开发语言
Korloa1 小时前
表达式(CSP-J 2021-Expr)题目详解
c语言·开发语言·数据结构·c++·算法·蓝桥杯·个人开发
yodala1 小时前
C++中的内存管理(二)
开发语言·c++
屁股割了还要学1 小时前
【数据结构入门】排序算法:插入排序
c语言·开发语言·数据结构·算法·青少年编程·排序算法
2 小时前
JAVA-15 (2025.08.20学习记录)
java·开发语言·学习