Join the Stack Overflow Community
Stack Overflow is a community of 6.6 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I have gpp installed in my Windows 7 (32 bit) as shown in the picture.

enter image description here

PATH variable gas g++

"%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\g++"

Still eclipse shows the error:

"Program "g++" not found in PATH".

How can this be resolved?

enter image description here

share|improve this question
1  
@paulsm4 The same error exist even when I changed the path as suggested. – Lijo Jul 29 '12 at 7:03
    
maybe can help - stackoverflow.com/questions/20024817/… – URL87 Dec 12 '13 at 9:44

17 Answers 17

Today I have bumped into this problem and solved it in the following way. I pressed "Reset defaults" button everywhere I could find it in Eclipse settings (for example, Preferences/C++/Build/Settings/Discovery). After that the error disappeared and the code compiled successfully.

share|improve this answer
6  
This helped me too. All was set up correctly, just the message was still showing. Reset Defaults in Preferences/C++/Build/Settings cleared the error for good. – compostus Dec 11 '12 at 12:42
    
Dont know why but this works for me when compiling GLUS with fresh install of mingw and eclipse c++ – publicENEMY Jul 9 '15 at 5:02

This is how i got rid of it.

  1. Install the MinGW.
  2. Select all files in the Basic Setup and select apply the changes.
  3. Select new C++ Project You will be able to see "MinGW GCC" in the toolchain section select the same and create project.
share|improve this answer
    
thanks you made my day – android maniac Jun 4 '15 at 18:29
1  
don't forget to add "C:\MinGW\bin" to your Windows Path variable! – Raphael Royer-Rivard Sep 10 '15 at 18:20

You need a gcc, g++ compiler toolchain (on your windows machine) for the eclipse which you have manually downloaded, One of the options can be done implicit via cygwin installation(by selecting proper development packages for gcc, g++) and then add the location of the compiled gcc ,g++ package like C:\cygwin\etc\alternatives to the PATH variable for windows environment.

After this open eclipse and go to Project->properties->C/C++ Tool Chain Editor and add replace default GNU C++ compiler and GNU C Compiler with Cygwin C++ compiler and Cygwin C compiler and rebuild the project. The errors related to gcc, g++ PATH not found will now be gone.

share|improve this answer

You need:

C:\cygnus\cygwin-b20\H-i586-cygwin32\bin

in the PATH.

and not

C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\g++

as you wrote.

share|improve this answer
    
The same error exist even when I changed the path as suggested. – Lijo Jul 29 '12 at 7:04
    
Did you restart your cmd.exe after changing the PATH. Did you check you have the new path with echo %PATH%? – ouah Jul 29 '12 at 10:13
    
I have reatrted the system - hope that will restart cmd.exe also. How to set the path with echo? The environment variable name is "Path" not "PATH". Is that a problem? – Lijo Jul 29 '12 at 14:15

I had the same problem, the only solution that worked for me was this:

  1. Open command-line and check whether "g++" actually executes the compiler
  2. If (1) works, uncheck Project->Build automatically in Eclipse
  3. Clean project
  4. Build project
share|improve this answer
1  
This worked! Nothing else here worked. Everything was setup correctly, but I had to uncheck Build automatically. Blah! – NateS Feb 15 '16 at 16:56

I got the same problem with mingw-64 (x86_64-4.9.1-release-posix-seh-rt_v3-rev1), Eclipse Luna 4.4.1 and CDT 8.5.0.201409172108, using Windows 7.

I solved this problem by putting the following two environment variables under

Window -> Preferences -> C/C++ -> Build-> Environment

  • name: MINGW_HOME value: (mingw installation directory without "\bin")
  • name: MSYS_HOME value: (msys installation directory without "\bin")

You can check

Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Built-in Compiler Settings MinGW [ Shared ]

, if it doesn't complain "Toolchain MinGW GCC is not detected on this system" then you're all set.

share|improve this answer

The PATH is locate at Project Properties > C/C++ Build > Environment (see screenshot below).

enter image description here

For your reference, I am using MinGW, I got the same error before I got the MSYS install. Later I found out that I also need MSYS to be install because the make.exe wasn't come with MinGW. (I don't this error was cause be MSYS.)

After MSYS is installed, add MSYS and MinGW path into environment variable, restart Eclipse. Remember to rebuild your project in order to rectify the error. If error still persist after restart, recreate the workspace. At least this has solved the problem on my site, hopes this help on you too.

Good luck!

share|improve this answer

I had the same problem: Eclipse couldn't find (g++) and (gcc) in PATH even they were accessible from command-line. I was also sure they are pointed by PATH correctly.

I have just deleted the (.metadata) folder from Eclipse's Workspace as a mean to reset it and this worked for me.

share|improve this answer

I had a similar problem. The error is raised, but the code is compiled and linked. The error was caused by the Error Parser using a different configuration than the one that is compiled.

The error parser configuration was only valid for the Linux configuration of my software. My active configuration was set for MinGW and Windows.

Solution:

  • In Elipse under Windows->Preferences->C/C++->Indexer set Build Configuration for the indexer to Use active build configuration.
  • Clean and rebuild, otherwise the old errors will remain visible
share|improve this answer

Maybe it has nothing to do here, but it could be useful for someone.
I installed jdk on: D:\Program Files\Java\jdk1.7.0_06\bin
So I added it to %PATH% variable and checked it on cmd and everything was ok, but Eclipse kept showing me that error.
I used quotation marks on %PATH% so it reads something like:

%SYSTEMROOT%\System32;"D:\Program Files\Java\jdk1.7.0_06\bin"

and problem solved.

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}"

I hope it helps.

share|improve this answer
    
In addition all "semantic errors" vanished – Martin Meeser Jun 28 '14 at 11:07

All the tips did not work for me using the Gaisler Tools for GR712RC Installation for OS RTEMS. I'm using the Eclipse Kepler. The simple way was making a copy of sparc-rtems-gcc.exe to gcc.exe and sparc-rtems-g++.exe to g++.exe in the C:\opt\rtems-4.10-mingw\bin Directory.

share|improve this answer

i think cgywin might not work for you as you can only compile your code in Win7 if you fire up the command prompt; you need to use MinGW compiler toolset instead. After you have install your compiler, go to Properties->C/C++ Build->Tool Chain Editor -> Change your current toolchain to MinGW GCC.

share|improve this answer

WINDOWS 7

If there is anyone new reading this, make sure to simply try a clean install of mingw before any of this. It will save you sooooo much time if that is your problem.

I opened up wingw installer, selected every program for removal, apply changes (under installation tab, upper left corner), closed out, went back in and installed every file (in "Basic Setup" section) availible. after that eclipse worked fine using "MinGW GCC" toolchain when starting a new C++ project.

I hope this works for someone else. If not, I would do a reinstall of JDK (Java Developer's Kit) and ECLIPSE as well. I have a 64bit system but I could only get the 32bit versions of Eclipse and JDK to work together.

share|improve this answer

In my case, I didnt mark for instalation the mingw32-gcc-g++ package in the installation manager, that's why eclipse didn't know it.

Needed to go to the instalation manager, mark it (in basic setup tab) and update catalogue

share|improve this answer

I had the same problem in Sublime..

  1. Right click on my computer
  2. Advanced system settings
  3. Environment variables
  4. in system variables, change path to location of '...\MinGW\bin'

Example: D:\work\sublime\MinGW\bin

share|improve this answer

Alrighty then,

First Install MinGW or other C/C++ compiler as it's required by Eclipse C++.

Use https://sourceforge.net/projects/mingw-w64/ as unbelievably the download.cnet.com's version has malware attached.

Back to Eclipse.

Now in all those path settings that the Eclipse Help manual talks about INSTEAD of typing the path, Select Variables and

**MINGW_HOME** 

and do so for all instances which would ask for the compiler's path.

First would be to click Preferences of the whatever project and C/C++ General then Paths and Symbols and add the

**MINGW_HOME** to those paths of for the compiler.

Next simply add the home directory to the Build Variables under the C++/C Build

Build Variables Screen Capture

P.S.: Vote for my answer to I can post pics directly, thanks.

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.