當(dāng)前位置:首頁 > IT技術(shù) > 數(shù)據(jù)庫 > 正文

centos7 gcc-11 gcc-c++-11 gdb-11 lex(flex) yacc(bsion)環(huán)境搭建
2022-09-06 22:57:54

參考:https://blog.csdn.net/qq_45316173/article/details/122018354

?

卸載舊版本

rpm -q gcc?

rpm -e [上一步查到的版本號]

?

執(zhí)行上面一條命令可能會報錯,卸載失敗:

error: Failed dependencies:

gcc = 4.4.7-23.el6 is needed by (installed) gcc-c++-4.4.7-23.el6.x86_64
gcc = 4.4.4 is needed by (installed) libtool-2.2.6-15.5.el6.x86_64

說明要卸載的程序已經(jīng)被其他程序依賴

將依賴gcc的程序卸載:

rpm -e gcc-c++-4.4.7-23.el6.x86_64
rpm -e libtool-2.2.6-15.5.el6.x86_64

然后,再次執(zhí)行卸載gcc的命令:

rpm -e [上一步查到的版本號]

?

yum -y install centos-release-scl

yum install -y devtoolset-11-gcc devtoolset-11-gcc-c++?devtoolset-11-gdb

scl enable devtoolset-11 bash

which gcc
which cc
which g++
which gdb

?

cat >> /etc/profile << EOF
export PATH=$PATH:/opt/rh/devtoolset-11/root/usr/bin
EOF

?

source /etc/profile

?

yum -y install flex
yum -y install flex-devel
yum -y install bison

?

本文摘自 :https://www.cnblogs.com/

開通會員,享受整站包年服務(wù)立即開通 >