Could not find full path g ++ and gcc

I am trying to install Eclipse Helios on Linux and I manage to install eclipse. However, errors occurred while running the simple world hello program. He says he cannot find the full path for g ++ and gcc and therefore I cannot run the program.

Is it related to Linux installation or eclipse installation? Please advise. Thank.

+3


source to share


4 answers


Ok, possibilities - either you didn't install g ++ before (or after) installing eclipse, or the path was not found by eclipse. Since the Eclipse installation itself does not include g ++, you need to install it separately using the terminal.

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

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

      

and hit enter. If it compiles, it means g ++ is installed differently, it will say command not found. If you are not using g ++ 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 to the newly installed compiler use this

$ which g++

      

and put the output path in Eclipse preferences

+3


source


First of all, the title is misleading, I recommend changing it to get better answers. check where your g ++ and gcc binaries are located: Terminal:

$ which g++
$ which gcc

      

the output will most likely look like this:

/ Usr / bin / g ++



and

/ Usr / bin / g ++



(in this case, if you get the path for gcc / g ++, your linux installation will most likely be fine and eclipse cannot find gcc and g ++)

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

+1


source


Have you installed gcc? If you have installed, perhaps you need to configure eclipse? This could be a problem.

0


source


In RHEL 7.3, you can do this to install a 64-bit compiler gcc/g++

:

$ yum install gcc-c++.x86_64

$ g++ --version



g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

      

0


source







All Articles