1

I am using Ubuntu 14.04 LTS. I want to install latest version of GCC 4.9.0. Is it possible to uninstall default GCC compiler prepacked with OS?

In this link, I read that uninstalling the default compiler may lead to stability issues Since I am planning to install the latest version, will that cause stability issue?

And another problem is that in the official GNU GCC page, I read that GCC supports compiling of c++ programs. But I couldn't compile a program using gcc. So, I used g++. By using g++ instead of GCC, It gave an error stating that g++ is not installed. Wouldn't Ubuntu come along with g++ or is there any other config to use g++ with GCC?

2
  • Running sudo apt-get install g++ will install g++ 4.8. Jun 17, 2014 at 12:13
  • I have downloaded the source tarball of GCC 4.9.0 from ftp server of gnu site. Is there a way to replace the existing gcc using this tarball file? Jun 18, 2014 at 3:31

1 Answer 1

0

You will need to build from sources gcc-4.9 (latest version is 4.9.1), here is a good, step by step, description of how to build and install gcc-4.9.1 on Ubuntu 14.04:

https://solarianprogrammer.com/2014/08/26/building-gcc-on-ubuntu-linux/

A short resume of what you need to do, please check the above link for more details:

  • Install build-essentials, gawk, m4, gcc-multilib
  • Download the source code for GMP, MPC, MPFR, GCC
  • Build and install them in this order (see the link for details):
    • GMP
    • MPFR
    • MPC
    • GCC

After that you should be able to invoke gcc-4.9.1, g++-4.9.1 and gfortran-4.9.1 from the Terminal.

2
  • Hello, thanks for you answer. Please have a look at the link I've posted, basically it is an entire article. Do you want me to copy/paste this article here ?
    – JeanC
    Aug 27, 2014 at 13:23
  • No, just telling the essential parts is fine - which you probably did in the meantime.
    – guntbert
    Aug 27, 2014 at 15:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .