centos6.6安装gcc4.9.1

本文发布时间: 2019-Mar-22
不用编译,执行下面三步即可cd /etc/yum.repos.dwget http://linuxsoft.cern.ch/cern/scl/slc6-scl.repoyum -y --nogpgcheck install devtoolset-3-gcc devtoolset-3-gcc-c++安装到了以下目录/opt/rh/devtoolset-3/root/usr/bin现在建立修改原来的gcc到现在的gcc[root@10-149-11-152 bin]# pwd/opt/rh/devtoolset-3/root/usr/bin[root@10-149-11-152 bin]# cd /usr/bin/[root@10-149-11-152 bin]# gcc --versiongcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)Copyright (C) 2010 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.[root@10-149-11-152 bin]# cp gcc gcc-4.4.7[root@10-149-11-152 bin]# c++ --versionc++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)Copyright (C) 2010 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.[root@10-149-11-152 bin]# cp c++ c++-4.4.7[root@10-149-11-152 bin]# rm gccrm: remove regular file `gcc'? y[root@10-149-11-152 bin]# rm c++rm: remove regular file `c++'? y[root@10-149-11-152 bin]# ln -s /opt/rh/devtoolset-3/root/usr/bin/gcc /usr/bin/gcc[root@10-149-11-152 bin]# ln -s /opt/rh/devtoolset-3/root/usr/bin/c++ /usr/bin/c++[root@10-149-11-152 bin]# gcc --versiongcc (GCC) 4.9.1 20140922 (Red Hat 4.9.1-10)Copyright (C) 2014 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.[root@10-149-11-152 bin]# c++ --versionc++ (GCC) 4.9.1 20140922 (Red Hat 4.9.1-10)Copyright (C) 2014 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:09pm
栏目列表