Compiling MingW based projects with Eclipse.
These instructions will show you how to setup Eclipse to compile MingW c projects. Specifically we will show how to compile Git for Windows with Eclipse using the MsysGit build environment. The following will be possible once this is complete:
- Compiling
- Code Completion
- Control + Left Mouse click to go to definition
- Place Breakpoints
- Inspect variables
Just follow these steps:
- Download and install the Eclipse IDE for C/C++ Developers from eclipse.org
Note: You may need to install the JDK in order to get Eclipse up and running - Clone the MsysGit build environment "recursively" from
https://github.com/msysgit/msysgit.git
- Start up eclipse and choose a workspace path as it wishes.
- Once in Eclipse go to Window -> Preferences -> General -> C/C++ -> Build -> Environment. Choose to Add a new variable called PATH. Add the two paths shown below seperated by a semi-colon as they would be in your environment.
Also be sure that the "Append variable to native environment" is checked.D:\Dev\msysgit\mingw\bin;D:\Dev\msysgit\bin
- Open up your existing project.
File -> New -> Makefile Project with Existing Code - Set the path to your existing code location.
- Go into the project properties.
- Under C/C++ Build -> Tool Chain Editor:
Set the current builder to "Gnu Make Builder"
- Under C/C++ Build -> Builder Settings:
Uncheck "Use default build command".
Uncheck "Generate Makefiles automatically".
Set the build directory to "${ProjDirPath}\.
- Under C/C++ Build -> Behaviour:
Set build (Incremental build) to "install"
- Try building and you should have success