Unable to find full path g++ and gcc

24,883

Solution 1

Okay, Possibilities are either you didn't installed g++ before (or after) installing eclipse or the path was not detected by eclipse. Since Eclipse's installation itself does not include g++ you need to install it separately using terminal.

Also as you didn't mention which Linux are you on, I am assuming Ubuntu/Debian.Now you need to check whether g++ is installed or not on your system.To do this: Open Terminal by pressing CTRL+ALT+T and then enter the following command

g++ <some c++ filename and path> -o output

and press enter.If it compiles that means G++ is installed else it'll say command not found.In case you don't have g++ installed use this command (this is ONLY for UBUNTU and its derivatives)`

sudo apt-get install g++

Also in case of previous broken installation, first use this command`

sudo apt-get autoremove g++

and then install! Now to get the path of the newly installed compiler use this

$ which g++

and put the output path in Eclipse preferences

Solution 2

first of all title is misleading, i will recommend to change it to get better answers. check where your g++ and gcc executable are located: Terminal:

$ which g++
$ which gcc

output is likely gooing to be:

/usr/bin/g++

and

/usr/bin/g++

(in this point if you get a path for gcc/g++ your linux installation is likely ok and eclipse can't find gcc and g++)

then go to eclipse yourProject > properties and set path/command for gcc and g++.

Share:
24,883
user3306996
Author by

user3306996

Updated on July 25, 2022

Comments

  • user3306996
    user3306996 almost 2 years

    I am trying to install Eclipse Helios on Linux and I manage to get eclipse installed. However, upon running a simple hello world program, errors occurred. It says unable to find full path for g++ and gcc and thus I am unable to run the program.

    Does it got to do with my linux installation or eclipse installation? Please advice. Thank you.