I can't compile a C++ program with the g++ command

If I try compiling my C++ source file by the following command:

g++ a.cpp

it outputs:

The program 'g++' can be found in the following packages: * g++ * pentium builder
try:
sudo apt-get intsall <<a>selected package>

However, if I run the suggested command (sudo apt-get install g++), it shows that everything is already installed.

So, basically, how do I compile a simple C++ program in Ubuntu 12.04?

2

1 Answer

Try this

sudo apt-get update

sudo apt-get install build-essential

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like