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.
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 useg++
for C++g++
depends ongcc
and not backwards.gcc
(standing for GNU Compiler Collection) should contain c++ compiler (g++
). In other words,g++
is supposed to be part ofgcc
package (wiki agrees).g++
comes withgcc
is up to the package maintainers. Notice that not havingg++
as a dependency makes ofgcc
a lighter package to install (not just in download size).