This page will guide you through a typical, one size fits all, installation of MinGW. If you are new to MinGW, you may wish to refer to the MinGW page to learn which packages are required, and which tools are used to perform which tasks. For more advanced installation instructions, refer to HOWTO Install the MinGW (GCC) Compiler Suite.
MinGW Installation Notes
MinGW may have problems with paths containing spaces, and if not, usually other programs used with MinGW will experience problems with such paths. Thus, we recommend that you do not install MinGW in any location with spaces in the path name reference; i.e. you should avoid installing into any subdirectory of "Program Files" or "My Documents", or the like.
No version numbering convention exists, for MinGW as a whole. Each package has its own version number, and the installer version number does not necessarily reflect the version number of any individual package which it installs.
Download the latest MinGW-5.x.x.exe installer from sourceforge.net and run the installer. When prompted to choose which package you wish, if unsure or if you have never used MinGW before, we recommend choosing the "current" package (the default option). You will then be able to choose which components you wish to install:
- MinGW base tools: This required component is composed of binutils, the C compiler, the runtime and platform API.
- ... compiler: This component install a compiler for the programming language specified in the label of the component. Usually, you will at least want to also install the C++ compiler.
- MinGW make: This component installs make, a program capable of interpreting Makefiles. This component is highly recommended as many IDE's require this functionality.
When choosing the "Destination Folder" for the installation, please consider not installing MinGW in a path that contains spaces unless you have read the installation notes above and are aware of possible problems.
The installer will then download and install the components selected.
As an alternative to the automated installer, you may install MinGW by manually downloading and uncompressing individual components.
Download at least the following (or newer) packages from the MinGW download page:
These are the minimum requirements for a working mingw-gcc-toolchain for C.
Optionally you may want to add any of the following additional languages:
- gcc-g++ for C++
- gcc-objc for Objective C
- gcc-gfortran for Fortran 90
- gcc-java for Java
- gcc-ada for Ada
Note that the GCC versions of these files must match the GCC version of the gcc-core installed.
Optionally you may want to add any of the following additional utilities:
- mingw-gdb for debugger
- mingw32-make for make
- mingw-utils for MinGW Utilities
- MSYS for Unix-style commands and shell (see the MSYS page for installation instructions)
- msysDTK for Unix-style developer toolkit
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
Download all packages to C:\MinGW
C:\MinGW> gzip -d -c binutils-2.19.1-mingw32-bin.tar.gz | tar x C:\MinGW> gzip -d -c gcc-core-4.4.0-mingw32-bin.tar.gz | tar x C:\MinGW> gzip -d -c mingwrt-3.15.2-mingw32-dev.tar.gz | tar x C:\MinGW> gzip -d -c w32api-3.13-mingw32-dev.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.4.5 and C:\MinGW-4.4.0. 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 Environment Variables button.
Updating single packages (e.g. when there is a new version of the w32api) can be done by copying the new package to C:\MinGW and unpacking as above to overwrite the older version. This manual update also works with an initial automated install.