Find problem solving problem: How to upgrade gcc on CentOS

Source: Internet
Author: User

Question : The default?gcc?version on CentOS are too old to build a particular application. How can I upgrade the version of?gcc?installed on CentOS?

??

As of CentOS 6.5, the default version of?gcc?installed is 4.4.7. If you want to Upgrade?gcc?on CentOS, can installdevtools, which is a centos version of? Red Hat Developer toolset. The?devtools, which is available for CentOS 5 and 6, contains a suite of development tools Including?gcc,?gdb,?binutils,?e Lfutils, etc. the?devtools?1.1. Offers?gccversion 4.7.2.

To Install?devtools?on CentOS, use the following commands.

$ sudo wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo-P/etc/yum.repos.d

$ sudo sh-c ' echo ' enabled=1 ' >>/etc/yum.repos.d/devtools-1.1.repo '

$ sudo yum install devtoolset-1.1

Devtools would beinstalled under?/opt/centos/devtoolset-1.1.

To Use?gcc?from?devtoolset, use the following command. This command would launch a new shell, wherein all environment variables is automatically set to Use?devtools.

$ SCL Enable devtoolset-1.1 bash

$ gcc--version

GCC (gcc) 4.7.2 20121015 (Red Hat 4.7.2-5)

Alternatively, you can explicitly define the following variables to Use?devtools.

Export CC=/OPT/CENTOS/DEVTOOLSET-1.1/ROOT/USR/BIN/GCC
Export Cpp=/opt/centos/devtoolset-1.1/root/usr/bin/cpp
Export cxx=/opt/centos/devtoolset-1.1/root/usr/bin/c++

??

From

Find problem solving problem: How to upgrade gcc on CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.