7

I have a new installation of Ubuntu linux and I am trying to update my gcc complier. The latest gcc compiler depends on gmp, mpfr, and mpc, so I downloaded those and placed the source into the gcc 4.8.1 source folder, as instructed.

configure seems to have run just fine. I did not include any options, because none seemed appropriate. I just ran with the defaults.

When I run make, I get the following error:

configure: error: C++ compiler missing or inoperational

make[2]: \*** [configure-stage1-libcpp] Error 1    
make[2]: Leaving directory `/home/clay/programming/C++/gcc-4.8.1'    
make[1]: \*** [stage1-bubble] Error 2    
make[1]: Leaving directory `/home/clay/programming/C++/gcc-4.8.1'    
make: \*** [all] Error 2

I am running out of a terminal window as root, and I did a make distclean and tried a second time, but no dice. I know it can find both gcc and cc because it says so in the make output.

Any ideas?

4
  • 2
    Aside, don't be root.
    – tripleee
    Aug 14, 2013 at 21:13
  • Can you run 'gcc' or 'g++' on the command line? What does it say? Just in case, a nice way to install the basics is 'apt-get install build-essential'.
    – Nick Veys
    Aug 14, 2013 at 21:14
  • You are right,m I shouldn't be root, but I haven't used linux for a few years and ran into some permissions issues I'd rather deal with later. Yes, gcc --help runs as expected. I am not familiar with apt-get install build essential. I'll have to look it up.
    – cassius
    Aug 14, 2013 at 21:18
  • Not gcc. g++. It's looking for a C++ compiler (see error message). gcc is a C compiler, not a C++ compiler. Aug 14, 2013 at 23:37

2 Answers 2

8

You need a C++ compiler to build GCC. On Ubuntu, the C++ compiler is in the package g++, separate from gcc (which is a C compiler, not a C++ compiler), so be sure to:

sudo apt-get install g++
4

first you should ensure a C++ compiler to build on your machine

yum install gcc-c++  
1
  • this solved my problem on CentOS 6 for compiling gcc4.9.1. Thanks.
    – Dean Chen
    Nov 8, 2016 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.