win32 F/OSS development - MinGW

Ming the Merciless

MinGW or "Minimalistic GNU for Windows", is the base for a ton of free compilers on Windows such as Ada, C and C++, Cobol, D, Fortran and Java. With it you can compile native Windows executables without needing any external dlls. On the C/C++ page we'll add the Qt toolkit, the SDL, an IDE, Glut and some other goodies.

Install

Head over to the MinGW Sourceforge page. The installer will be named MinGW-X.X.X.exe where X.X.X is the version number. Download and run the installer. Select 'Download and Install' when prompted. You'll have a choice of version; I recommend 'Current'. Next you'll have the choice of adding compilers; at the very least, select make and g++ (for c++). I tend to install in the default directory C:\MinGW\ The installer will then download the packages it needs and install them.

You'll want to add the C:\MinGW\bin directory (assuming you installed to C:\MinGW) to your path Environment variable. Do this by opening up the control panel and then the 'System' applet. Click the 'Advanced' tab, then the 'Environment variables' button. Edit (or add if it doesn't exist) the user variable 'PATH'. Entries are seperated by a semicolon as in:

C:\Python24;C:\MinGW\bin

Next up grab the MSys installer. This gives you enough of the *nix tools to run config and make scripts. It's a Windows installer package, so just run the file. After it installs, it will run a post install script to configure things. When prompted for the path of your MinGW install, make sure to give just the root path using unix style slashes:

C:/MinGW/

Now to verify things are good to go open a command prompt and run the following:

c:\>gcc -v

Reading specs from C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=
mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable
-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --e
nable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-ja
va-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchroniz
ation --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.2 (mingw-special)

Documentation






< < Back to Start >>