Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I run Ubuntu 13.04 (x86_64 if it matters) which I recently installed. Before, when using 12.10, I had both gcc and g++ from the beginning. However, with 13.04 after I downloaded gcc-4.8.1 sources I found out I was not able to build it due to lack of a C++ compiler. I tried g++ in console and it said the program was not installed. gcc -v shows c++ among other languages in --enable-languages.

So, the question basically is: how come gcc package does not contain the C++ compiler (g++)? I know (well, at least I guess) I can install it by running

sudo apt-get intall g++

but I wonder if I can somehow make my pre-installed gcc package work. Maybe linking gcc to g++ or something? I am pretty sure with Ubuntu 12.10 I had g++ from the beginning.

share|improve this question
Why not just install build-essential? It will allow you to make all this work without any other hassle. Also, gcc is the C compiler not the C++ compiler, so you have to use g++ for C++ – Thomas Ward Jul 23 '13 at 20:09
Read What is the difference between g++ and gcc?. It clarifies why g++ depends on gcc and not backwards. – edwin Jul 24 '13 at 0:04
Yes but gcc (standing for GNU Compiler Collection) should contain c++ compiler (g++). In other words, g++ is supposed to be part of gcc package (wiki agrees). – Cthulhu Jul 24 '13 at 17:01
Yes, but it is not a strict dependency. You can have a C compiler without needing a C++ one. In the end, whether g++ comes with gcc is up to the package maintainers. Notice that not having g++ as a dependency makes of gcc a lighter package to install (not just in download size). – edwin Jul 26 '13 at 0:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.