How to setup the MinGW gcc tools for your Managed Make C Project in CDT 3.1 and Eclipse 3.2
"/usr/bin/sh: c:mingwbinmingw32-gcc: command not found"error. This was because I had "c:\cygwin\bin" in my path. To remedy this, you can set the "PATH" environment variable for your project. This will allow you to search the "c:\mingw\bin" path instead of the "c:\cygwin\bin" path without changing your path outside of Eclipse. This is also the solution if you have the wrong "include" directories listed in your "Includes" folder. E.g., if you have cygwin directories in your "Includes" folder, probably the cygwin gcc command is being used. See also my other post, How to set the include paths for gcc in a Managed Make project in Eclipse 3.2.1 and CDT 3.1
Update 2/5/2007:
You will also likely get a warning which says:
Error launching 'cygpath' command'
See my post, Eclipse/CDT bug: Error launching 'cygpath' command about that.
To setup a GDB debugger, see my post, How to use the mingw gdb debugger with Eclipse 3.2 / CDT 3.1
Also, here is another good tutorial about setting up CDT: http://max.berger.name/howto/cdt/
Here are the detailed steps:
- Right-click on your project and select "Properties"
- Select "C/C++ Build" from the sidebar
- Click the "Tool Settings" tab
- Click the "GCC C Compiler" and enter "mingw32-gcc" in the "Command:" field
- Click the "GCC C Linker" and enter "mingw32-gcc" in the "Command:" field
- Click the "Build Settings" tab
- Uncheck the "Use default command" checkbox
- Replace "make" with "mingw32-make -k"
- Click the "Environment" tab; click the "Configuration" tab
- Click the "New" button
- From the "Name" dropdown box, select "Path"
- In the "Value" field, delete the contents and enter "C:\mingw\bin"
- In the "Delimiter" field, leave it as ";"
- In the "Operation" field, select "Replace"
- Click "OK"; click "OK"
Comments
thanks! u save my life!!!!!im new in eclipse. i need one with C++ plugin to deal with my project. i do the whole day just to get the hello world compiled. phew~
In my case cygwin wasn't in my path and I still got "/usr/bin/sh: c:mingwbinmingw32-gcc: command not found"
The only solution I found was to remove cygwin from my machine altogether.
I downloaded eclipse 3.3.0 and CDT 4.0 for windows XP (the last versions). The project dialog box is sadely different.
Moreover, it wants to create a directory named
[java.lang.String;@1087070
this last number not always the same. But this directory name is not valid under windows. So, during compile or link time, several "Include path not found" are generated.
Welldone Friend !
I came to see a lot of articles regarding the configuration settings for C++ development in Eclipse/ Everyone is saying bla bla bla..
But you have told the exact way.
Many mnay thanks !!