Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
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) –  arhimed Aug 4 '12 at 8:45

5 Answers 5

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

share|improve this answer

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.

share|improve this answer
    
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. –  Shiki Jun 14 '13 at 14:13

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.

share|improve this answer

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.

share|improve this answer

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}"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.