作者:絆疯绊野半温柔 | 来源:互联网 | 2023-01-09 18:15
我正在尝试在Linux上安装gcc和g ++ 4.9.2.我是Linux的新手,我看到了一些如何安装的指南,但每次遇到另一个问题.我的机器上现在没有任何gcc.我的Linux版本是:Red Hat Enterprise Linux Server 7.4版(Maipo)有人可以帮助我并从头到尾给我指示如何正确地做到这一点?非常感谢你.
1> Lars Bilke..:
yum install centos-release-scl-rh
yum install devtoolset-3-gcc devtoolset-3-gcc-c++
update-alternatives --install /usr/bin/gcc-4.9 gcc-4.9 /opt/rh/devtoolset-3/root/usr/bin/gcc 10
update-alternatives --install /usr/bin/g++-4.9 g++-4.9 /opt/rh/devtoolset-3/root/usr/bin/g++ 10
似乎我们需要在安装后使devtoolset-3在bash中工作。`source scl_source enable devtoolset-3`
2> Knud Larsen..:
要安装系统编译器gcc,g ++,install命令是# yum install gcc-c++
→提供版本4.8.5 : /usr/bin/{ gcc, g++ }
.
其他选项:1.gcc53-c ++ - 5.3.0-1.el6.x86_64.rpm→ https : //drive.google.com/file/d/0B7S255p3kFXNbTBneHgwSzBodFE/view ? usp = sharing :下载并安装:# cd Downloads/ && yum install ./gcc53-c++-5.3.0-1.el6.x86_64.rpm
... ..提供/usr/bin/{gcc53, g++53}
.
该devtoolset's:https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/ →交通
# yum-config-manager --enable rhel-server-rhscl-7-rpms
安装gcc,g ++版本4.9.2: # yum install devtoolset-3-gcc-c++
注意:您可以同时安装任意数量的gcc/g ++版本.(系统编译器是必须的.)
gcc49-c ++ - 4.9.3-1.el6.x86_64.rpm https://drive.google.com/file/d/1Pwq1ua80dGM72i7rpDNAIIdfcR1WK-hG/view?usp=sharing→提供/usr/bin/{gcc49, g++49}
.
gcc63-c ++ - 6.3.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1t4WrgvpEP-6_NN3qMJhz9MS3CJhHrHKc/view?usp=sharing→提供/usr/bin/{gcc63, g++63}
.
gcc45-c ++ - 4.5.4-1.el7.x86_64.rpm https://drive.google.com/file/d/15aRg-BPhuyaEyZA9Jy-iAyC21_pwN7nD/view?usp=sharing→提供/usr/bin/{gcc45, g++45, gfortran45}
gcc42-c ++ - 4.2.4-1.el6.x86_64.rpm https://drive.google.com/file/d/1eYWk6Nd63xeqqAUoJldNWRuwEGO6cAyv/view?usp=sharing→提供/usr/bin/{gcc42, g++42}
谢谢你,你的答案非常有帮助,但我还有一个问题.如果我想安装gcc 6.2,我怎么能找到这个特定版本的编译器?因为你给了我一个安装c ++ - 5.3-1的选项.我在哪里可以找到其他版本?