Hi all,
When I enter following statement in terminal i am getting following error can any one please help me
>> g++ 1.cpp
Message is Can't find g++ command
Is there any way to compile Cpp program? iam using Ubuntu 7.0.4 at this moment
If I have even tried to install gcc 4.3.0 in order to fix this issue but I am unable to succed in that buid
Please advise
Thanks
@Jayadheer
The error you have menctioned was g++ compiler missing so You need to install the build-essential package using the following command from your terminal
sudo aptitude install build-essential
After installing this you can try to compile your program it should work.
I don’t want to sound like a jerk, but isn’t that a pretty basic problem to be posting on a how-to guide for linux?
However, if you already have GCC installed (installing build-essential will work), then a link may have broken or otherwise damaged your g++ bin file, wherever it may be.
You should also be able to apt-get g++. gcc is only for plain ol’ C. g++ is for C++
Try install build-essential and linux headers:
sudo apt-get install build-essential
sudo apt-get install linux-headers-`uname -r`
sudo aptitude install g++
It can’t find g++ because the compiler is called g++-4.2.
All you have to do is create a link to g++-4.2 in /usr/bin and name it g++.
sudo aptitude install g++