View on GitHub

Rick Burgstaler

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:

  1. Compiling
  2. Code Completion
  3. Control + Left Mouse click to go to definition
  4. Place Breakpoints
  5. Inspect variables

Just follow these steps:

  1. 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
  2. Clone the MsysGit build environment "recursively" from
    https://github.com/msysgit/msysgit.git
  3. Start up eclipse and choose a workspace path as it wishes.
  4. 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.
    D:\Dev\msysgit\mingw\bin;D:\Dev\msysgit\bin
    Also be sure that the "Append variable to native environment" is checked.
  5. Open up your existing project.
    File -> New -> Makefile Project with Existing Code
  6. Set the path to your existing code location.
  7. Go into the project properties.
  8. Under C/C++ Build -> Tool Chain Editor:
    Set the current builder to "Gnu Make Builder"
  9. Under C/C++ Build -> Builder Settings:
    Uncheck "Use default build command".
    Uncheck "Generate Makefiles automatically".
    Set the build directory to "${ProjDirPath}\.
  10. Under C/C++ Build -> Behaviour:
    Set build (Incremental build) to "install"
  11. Try building and you should have success