5

I installed the newest Eclipse Juno manually (not through software center nor apt-get), and then install Eclipse CDT from the help > install new software menu.

However, when I try to compile a simple C++ code it show errors like Program "g++" not found in PATH.

I tried g++ from terminal and it worked just fine. Anyone know where the problem might be?

1
  • You should set up path for g++ in Project -> Properties or Window -> Preferences->'sth like Eclipse CDT'(I'm sorry that I give so less info , I never worked with CDT, but I had the same with Python 3)
    – Viktor K
    Aug 4, 2012 at 8:45

5 Answers 5

4

You should install the build-essential

sudo apt-get install build-essential

after installing this, open a terminal, and type g++ (hit enter) if it says there is no input, then you got your g++

even after you installed this, you could still have problems with eclipse cdt so I really recommend Netbeans, click here.

All you need to do is download Netbeans to your computer, say it's in your Download folder

sudo chmod +x your_download_netbeans.sh

then ./your_download_netbeans.sh

Because you already installed Eclipse on you computer, so I think you've already got jdk installed.

1
  • This is the correct answer. If you install build-essential, you have g++. In path too. And you should always download Eclipse and Netbeans from their respective websites.
    – Apache
    Jun 14, 2013 at 14:13
4

Annoying problem, no answers to be found... I added the path variable to environment variables in Window/preferences/build/environment It works since.

0

The g++ compiler is in the /usr/bin directory. The "sources.mk" file is generated and contains the path to the compiler. The path is not being generated. I edited the file to add the path to the C++_SRCS parameter. Ignore the do not edit at the top.

C++_SRCS := /usr/bin

Make sure that you've done the "install essential" as described above.

0

I had similar problem and I solved it by:

  1. Installing g++ The GNU C++ compiler using Ubuntu Software Center

  2. Changing in: Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build in Complier Settings [Shared]
    from: ${COMMAND} -E -P -v -dD "${INPUTS}"
    to: /usr/bin/${COMMAND} -E -P -v -dD "${INPUTS}"

I hope it helps.

0

I had similar problem and I solved it by:

Installing g++ The GNU C++ compiler using Ubuntu Software Center

Changing in: Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build in Complier Settings [Shared]

from:

${COMMAND} -E -P -v -dD "${INPUTS}"

to:

/usr/bin/${COMMAND} -E -P -v -dD "${INPUTS}"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .