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
- The MinGW installer package (mingw-get-inst-20111118.exe).
- Java Runtime Environment (JRE 6, update 30)
- Eclipse (Eclipse IDE for C/C++ Developers, select 32bit or 64bit depending on your JRE)
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
- http://www.blogistan.co.uk/qt/2009/12/where_get_mingw_qt_46.php
- http://max.berger.name/howto/cdt/ar01s03.jsp
- http://wiki.openttd.org/Compiling_on_MinGW
- http://trac.enlightenment.org/e/wiki/EFLWindowsXP
- http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite
- http://www.mingw.org/wiki/MSYS
12 responses
Why is the jdk required?
Actually, that’s my mistake, the Java runtime should be enough (It’s for Eclipse)
Have you compiled new OSG version 3.0.1 with MinGW ? do you have binariers ?
Haven’t tried it yet, but I think the procedure should be the same.
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.
Can you check with windows explorer if the binary is created properly? Maybe eclipse uses the wrong path when trying to launch the executable.
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?
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.
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.
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?
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.
I have a problem.I have #include , but there also be a compile error when invoke the function.