This page explains how to download and install MinGW.
The first 3 things you need to know
1. To use MinGW, start with downloading binutils, gcc-core, w32api and runtime. Whatever you'll do you'll always need these. Adding additional languages (g++, g77, ada etc.) may be done now or at any later stage. You may wish to download (the very useful but purely optional) MSYS binaries installation file from MinGW downloads page as well. You may need to download additional installation files later (for other languages).
- MSYS installation file - This installation file contains basic Unix-style commands plus a commandline shell. This will give you a MinGW commandline application (to be used instead of Windows(TM)' cmd.exe) together with Unix-style commands like ls, grep, cat, etc..
But remember: to use the MinGW compiler toolchain this is not required -- it simply is a rather useful addition. Note also that while the order of installation is arbitrary it is a good idea to install the compiler toolchain, (MinGW), BEFORE installing MSYS because then the MSYS installation will be automatically set up with the appropriate MinGW paths, etc.
3. Version numbering for Mingw as a whole does not exist; in particular, the version number of the MinGW installer is in no way related to the version of GCC which it installs. Dates of last changes are available from MinGW downloads page. The version of GCC installed may be determined by executing the command `gcc --version'; please report this, if asking for help.
(For those impatient to get up and running real fast, you might like to try the page RealDumbQuickstart.)
(If you want to create native Windows applications using GTK+ and Glade, take a look at GladeGuide.)
What to get
If you're undecided upon what you need or want, we would recommend installing all three packages in the Quick Intro section of this page. If you follow this recommendation, you'll have everything you basically need, and no troubles at all.
- MSYS-NNN.exe, MinGW-NNN.exe, msysDVLPR.tar.gz, msysDTK-NNN.exe: A shell with automatic configuration developer tools and two compilers: one native Windows(TM) compiler to compile native Windows(TM) applications, and a compiler to compile applications that will only run under this shell.
This section gives a very brief overview of the installation procedure for MinGW, and related packages; more detailed, package specific instructions will be found below. Note that, unless you are installing for shared use by multiple users, you should not need administrative privileges to install any MinGW package.
NOTE: As of October 16, 2005, the MinGW-4.NN.exe installer is broken, and has been withdrawn from the "current" download offering. It's probably best for noobs to just wait until it's working again. There have been a few threads about this on the mailing list and it looks just too darn hard for newbies to try to install MinGW from the raw packages. If you are desperate to get started, you might like to try the MinGW-3.1.0.exe version, from the "previous" section, or, for the brave, the latest MinGW-5.NN.exe version from "proposed".
Download MinGW-NNN.exe, MSYS-NNN.exe, msysDTK-NNN.exe and install them in this order.
Full Description of how to get started
This package is the compiler toolset. According to page MinGW: A collection of freely available and freely distributable Windows(TM) specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows(TM) programs that do not rely on any 3rd-party C runtime DLLs.
This package is self-sufficient: that means that by just installing this package, you can compile native Windows(TM) applications without any additional packages. Along with an optional IDE, this is all you need, if you don't require a Unix-like shell, or autoconf tools.
ada?: Ada compiler
All these components are in binary form (the source code is not included in the package, but can be obtained from the same download page as the components). Also, please note that all these programs are MinGW compiled programs: they do not rely on the MSYS DLL; that means these programs are native Windows(TM) programs.
The headers contained in this package are the headers needed to compile native Windows(TM) programs: they are not the same as the headers included in MSYS. In other words, trying to compile source code that is not designed for Windows(TM) with only this package will probably fail miserably.
The installation of this package is preferably done after installing the MinGW-NNN.exe package as this package will try to automatically configure itself to use the pre-installed MinGW package.
This is the main package that contains the shell. If you plan to compile non-native Windows(TM) source code (such as any MSYS source-code) then this package is a must. According to the page MSYS: A Minimal SYStem to provide POSIX/Bourne configure scripts the ability to execute and create a Makefile used by make.
misc. tools: cp, diff, gzip, head, sed, ...
msysDTK-NNN.exe (MSYS Developer Tool Kit)
How to install msysDTK?
This package provides common packages that are needed by developers but are currently just easier to provide dependent on the msys runtime dll. These were chosen because they are the ones that most developers frequently use and need.
msysDVLPR.tar.gz (MSYS Developer)
How to install msysDVLPR?
This package is the compiler toolset for MSYS and MSYS only. It will compile applications that will require the MSYS DLL; it does not compile native Windows(TM) applications! For the latter, you should install MinGW-NNN.exe
These are the minimum requirement for a working mingw-gcc-toolchain for C.
Note that the GCC versions of these files should match the GCC version of the gcc-core installed.
You will also need a program that can extract tar.gz files, such as the GUI-based WinZip or 7-Zip, or the command-line tar and gzip tools. Command line tools are provided by MSYS, or Google for 'gnu+tools+win32' to find alternatives. The GnuWin32 project provides Windows-native builds of tar and gzip CLI tools.
Create a directory (e.g. C:\MinGW), download all packages to C:\MinGW, for each package execute gunzip/untar package, and add C:\MinGW\bin to your PATH environment variable:
C:\Documents and Settings\Owner> cd /d c:\ C:\> md MinGW C:\> cd MinGW
C:\MinGW> gzip -d -c binutils-2.17.50-20060824-1.tar.gz | tar x C:\MinGW> gzip -d -c gcc-core-3.4.5-20060117-3.tar.gz | tar x C:\MinGW> gzip -d -c mingw-runtime-3.14.tar.gz | tar x C:\MinGW> gzip -d -c w32api-3.11.tar.gz | tar x C:\MinGW> set path=C:\MinGW\bin;%path%
The whole C:\MinGW subtree is fully relocatable which means there can be several different versions of the MinGW toolchain installed in parallel, e.g. in directories C:\MinGW-3.3.3, C:\MinGW-3.4.2 and C:\MinGW-3.4.5. Switching between these is merely a matter of renaming directories, assuming C:\MinGW\bin has been added to the path. You can permanently add C:\MinGW\bin to the path by opening the System control panel, going to the Advanced tab, and clicking the Environmental Variables button.