How to install MinGW, MSYS and Eclipse on windows

Notes

This is a short guide on how to install MinGW and MSYS using the latest stable. This guide has been updated on 21/12/2011

Requirements

Installing the MinGW and Msys

  • Run mingw-get-inst-20111118.exe
  • Choose “Download latest repository catalogues”
  • Accept the license agreement
  • Use the default folder (C:\MinGW)
  • When asked to select the components, choose: C Compiler, C++ Compiler, MSYS Basic System and MinGW Developer Toolkit.
  • Add C:\MinGW\bin;C:\MinGW\msys\1.0\bin; to your PATH system variables (at the beginning).
  • Done.

Check if your PATH system variables look something like this:

Install the IDE

  • Install the JRE with the default settings
  • To install eclipse, unzip the content to C:\Program Files\eclipse
  • Create a shortcut to Eclipse.exe on the desktop
  • Done.

Creating a HelloWorld Project

  • Open up Eclipse
  • File > New > Project
  • Select C/C++ > C++ Project
  • Click on Next
  • Change project name to “Hello World”
  • Click on Hello World C++ Project (Toolchain should show MinGW GCC)
  • Click Finish
  • On the left side, right click on your project (in the Project Explorer)
  • Choose Build Project
  • Run > Run (or Run > Debug)
  • The Console (at the bottom) should show !!!Hello World!!!
  • You’re all set.

Optional packages to install (use the MinGW console)

  • mingw-get install msys-wget
  • mingw-get install msys-zip
  • mingw-get install msys-unzip

Additional resources


12 responses

  1. Why is the jdk required?

    Frank Henard – May 12th, 2010
  2. Actually, that’s my mistake, the Java runtime should be enough (It’s for Eclipse)

    Laurence Muller May 12th, 2010
  3. Have you compiled new OSG version 3.0.1 with MinGW ? do you have binariers ?

    Lukas – September 23rd, 2011
  4. Haven’t tried it yet, but I think the procedure should be the same.

    Laurence Muller October 12th, 2011
  5. I archieve the tutorial. Mingw is working well (I succeed to compile a program using windows cmd.exe). I created a new project (with the c language instead of c++) , toolchain showed Mingw gcc. But when i tried to run (ctrl F11) a error message appeared : Launch Fail Binary not Found.

    Guillaume – June 19th, 2012
  6. Can you check with windows explorer if the binary is created properly? Maybe eclipse uses the wrong path when trying to launch the executable.

    Laurence Muller June 20th, 2012
  7. I had the same, I did a few things and then I didn’t get the error anymore. 1) closed all other projects: right-mouse on this project and select ‘Close Unrelated Projects’. Not sure if this one’s relevant but I had a number of Java projects opened so who knows 2) “Project>> Clean…” >> clean all 3) “Project>> Build All” That fixed Guillame’s error (which I was having too). I do think that there’s still something not going 100% right. This is the output in the Console now: ————————————————————— ** Build of configuration Debug for project hellocplusplus ** ** Internal Builder is used for build ** Nothing to build for hellocplusplus ————————————————————— Any ideas?

    Adriaan August 13th, 2012
  8. I’ve updated the guide, seems like it doesn’t autobuild the binary. Just select your project on the left side, rightclick it and hit build project. That will give you a working binary.

    Laurence Muller August 14th, 2012
  9. I also had this problem. To fix, I reinstalled mingw and chose the option to download the latest builds during the install and installed the optional things with mingw console.

    Matt – October 7th, 2012
  10. I download the mingw-installer, it only offers to me 32 bit settings, I searched about a 64 bit version of mingw, but it doesn’t come with a setup , can you give some reference about how can i install and configure mingw-64 for OpenSceneGraph and sugest a good IDE for work?

    Michel – May 6th, 2014
  11. Hi Michel, unfortunately I haven’t tried out the 64bit version of MinGW so I’m not sure if it will work well with OpenSceneGraph. For the IDE, I’d try to use the latest 64 bit Eclipse with the C/C++ plugin.

    Laurence Muller May 16th, 2014
  12. I have a problem.I have #include , but there also be a compile error when invoke the function.

    undefined reference to `DES_set_key_unchecked' – December 6th, 2016