Probem with gcc Compiler in Ubuntu

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

Sponsored Link

You may also like...

7 Responses

  1. admin says:

    @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.

  2. Alan says:

    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.

  3. You should also be able to apt-get g++. gcc is only for plain ol’ C. g++ is for C++

  4. krzys says:

    Try install build-essential and linux headers:

    sudo apt-get install build-essential
    sudo apt-get install linux-headers-`uname -r`

  5. Pete[r] says:


    sudo aptitude install g++

  6. 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++.

  7. Fabian says:

    sudo aptitude install g++

Leave a Reply

Your email address will not be published. Required fields are marked *