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 or a script to automatically download needed files (until mingw-get becomes available), refer to HOWTO Install the MinGW (GCC) Compiler Suite. Google's depot_tools project offers automated tools that can help install MSYS and other MinGW source and programs. See Community Supplied Links and look under the Build Utilities section for relevant URLs and more information on installation using depot_tools. There is also some introductory information for users who are new to MinGW.
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 strongly 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.
Note: The automated installer is now considered deprecated, and is currently unmaintained; it will not install GCC 4. You will get GCC 3 using this method. If you want to install the latest GCC release, use the Manual Installation method below.
A new automated installer currently in development, mingw-get, is planned to automatically install GCC 4. It will have both a graphical user interface (GUI) and a command line interface (CLI), either of which can be used to install all packages in GCC 4.
Download the latest MinGW-5.x.x.exe installer from sourceforge.net and run it. 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 libraries and platform API.
- ... compiler: These components each 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 for those who don't want to also install MSYS; many IDE's require this functionality.
When choosing the "Destination Folder" for the installation, please do not choose any path that contains spaces in its absolute name, unless you have read the installation notes above and are willing to accept the possible consequences; if you are in any doubt, accept the default.
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 extracting individual components. Please refer to the release notes for detailed notes, including known issues.
Before proceeding, you are encouraged to also consult the release notes for each individual package; links to these will be found adjacent to each package file entry, on the MinGW Download Page.
Download at least the following (or newer) packages from the MinGW Download Page; where two or more component packages are indicated, you need both / all of them. (Note that the package links provided here refer to current releases at the time of writing; these links may not necessarily be updated immediately, when new releases become available):
- mingw-runtime (dev and dll)
- Required runtime libraries for GCC:
- gcc-core (bin and dll)
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; (for each which you choose to install, you need both the bin and the dll component packages):
- gcc-g++ (bin and dll) for C++
- gcc-objc (bin and dll) for Objective C
- gcc-gfortran (bin and dll) for Fortran 90/95
- gcc-java (not yet available) for Java
- gcc-ada (bin and dll) 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 may also want the following additional features:
You will also need a program that can extract .tar.gz and .tar.lzma files, such as 7-Zip or command-line tar, gzip, and lzma tools. A basic standalone tar program bsdtar that includes gz and lzma support is available from the MinGW project.
Create a directory (e.g. C:\MinGW), download all packages to C:\MinGW, extract the files from each 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>7z x binutils-2.20.1-2-mingw32-bin.tar.gz C:\MinGW>7z x binutils-2.20.1-2-mingw32-bin.tar C:\MinGW>7z x mingwrt-3.18-mingw32-dev.tar.gz C:\MinGW>7z x mingwrt-3.18-mingw32-dev.tar C:\MinGW>7z x mingwrt-3.18-mingw32-dll.tar.gz C:\MinGW>7z x mingwrt-3.18-mingw32-dll.tar C:\MinGW>7z x w32api-3.14-mingw32-dev.tar.gz C:\MinGW>7z x w32api-3.14-mingw32-dev.tar C:\MinGW>7z x mpc-0.8.1-1-mingw32-dev.tar.lzma C:\MinGW>7z x mpc-0.8.1-1-mingw32-dev.tar C:\MinGW>7z x libmpc-0.8.1-1-mingw32-dll-2.tar.lzma C:\MinGW>7z x libmpc-0.8.1-1-mingw32-dll-2.tar C:\MinGW>7z x mpfr-2.4.1-1-mingw32-dev.tar.lzma C:\MinGW>7z x mpfr-2.4.1-1-mingw32-dev.tar C:\MinGW>7z x libmpfr-2.4.1-1-mingw32-dll-1.tar.lzma C:\MinGW>7z x libmpfr-2.4.1-1-mingw32-dll-1.tar C:\MinGW>7z x gmp-5.0.1-1-mingw32-dev.tar.lzma C:\MinGW>7z x gmp-5.0.1-1-mingw32-dev.tar C:\MinGW>7z x libgmp-5.0.1-1-mingw32-dll-10.tar.lzma C:\MinGW>7z x libgmp-5.0.1-1-mingw32-dll-10.tar C:\MinGW>7z x pthreads-w32-2.8.0-3-mingw32-dev.tar.lzma C:\MinGW>7z x pthreads-w32-2.8.0-3-mingw32-dev.tar C:\MinGW>7z x libgomp-4.5.0-1-mingw32-dll-1.tar.lzma C:\MinGW>7z x libgomp-4.5.0-1-mingw32-dll-1.tar C:\MinGW>7z x libssp-4.5.0-1-mingw32-dll-0.tar.lzma C:\MinGW>7z x libssp-4.5.0-1-mingw32-dll-0.tar C:\MinGW>7z x gcc-core-4.5.0-1-mingw32-bin.tar.lzma C:\MinGW>7z x gcc-core-4.5.0-1-mingw32-bin.tar C:\MinGW>7z x libgcc-4.5.0-1-mingw32-dll-1.tar.lzma C:\MinGW>7z x libgcc-4.5.0-1-mingw32-dll-1.tar 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.5.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.