Linux/redhat compiling and installing the GNU gcc 4.9.0 (g++)

Source: Internet
Author: User

Here is said to compile the installation, Yum/apt-get and other installation methods are relatively simple, do not elaborate!


1. Download the source code package: gcc.gnu.org


2, decompression:

TAR-XJVF gcc-4.9.0.tar.bz2


3 . Download the dependent packages required for compilation:

The simplest way to run directly:

./contrib/download_prerequisites

The script itself actively downloads the dependency package GMP, MPFR,MPC. It is also possible to manually download and then move to the/gcc-4.9.0 folder to install it yourself, or to compile the installation yourself first


4. run configure command to generate makefile:

mkdir Build
CD Build
.. /configure--enable-checking=release--enable-languages=c,c++--disable-multilib

First create the build folder and compile it into this folder


5.Compile

Make-j4
4 indicates the number of threads, longer, and faster with multiple threads

6. Installation

Make install


Questions:

C + + compiler missing or inoperational

g++ Command not found

Checking dependency style of g++ ... none

No usable dependency style found

The above problems are because the system does not have a C + + compiler, 4.8 or 4.9 before the need to have an ISO c++98 compiler, installed a OK, I do not know which can be installed in an earlier version of GCC, such as 4.4.7

The compilation process is recorded in Config.log, and there is a problem to view the file first.

Google is one of the best ways to solve this problem!

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.