CentOS 7 Gcc 10/11 (预构建)
GCC 11 使用举例
创建目录
mkdir -p /opt/usr/local
下载 && 解压 GCC
wget https://media.cooluc.com/source/gcc-prebuilt/gcc-11.1.0.tar.gz
tar zxf gcc-11.1.0.tar.gz -C /opt/usr/local/
添加变量
cat >> /etc/profile <<"EOF"
export PATH="/opt/usr/local/gcc-11.1.0/bin:$PATH"
export C_INCLUDE_PATH="/opt/usr/local/gcc-11.1.0/include"
export CPLUS_INCLUDE_PATH="/opt/usr/local/gcc-11.1.0/include"
EOF
添加共享库
echo "/opt/usr/local/gcc-11.1.0/lib64" > /etc/ld.so.conf.d/gcc-11.1.0.conf
生效变量
source /etc/profile
ldconfig -v
检验 GCC 版本
gcc --version