Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find full path g++ and gcc

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.

like image 421
user3306996 Avatar asked Aug 11 '14 03:08

user3306996


People also ask

How do I get the g++ path?

Or, open a DOS command prompt window (Start > Programs > Command Prompt), connect to the C: drive using the cd command, and type full. At this point you can see the PATH variable either in the User Variables or in the System Variables. Add the g++ path into either of the the PATH variables.

How do I find my gcc path?

You need to use the which command to locate c compiler binary called gcc. Usually, it is installed in /usr/bin directory.

Does G ++ install gcc?

The above meta-package installs the number of packages including g++ automatically, gcc, and make.


1 Answers

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

like image 140
Ronak Jain Avatar answered Sep 19 '22 14:09

Ronak Jain