If you are new to MinGW, see the instructions for Getting Started with MinGW to use the GUI and/or command line automated installers. If you prefer a very manual installation, continue with the instructions on this page.
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 and libexpat 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 as described in Environment Settings below.
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.
Information on other libraries commonly used by Open Source compiled using MinGW is available on the Libraries and Tools page.
When you install command line tools, such as MinGW, or GnuWin32 tools, you have to tell the command line interpreter where to find them; this is usually accomplished by adding the appropriate directory names to the PATH variable in your environment. Typically, it is your responsibility to do this; please do not expect the installer, (if you used one), to do it for you.
Warning: Adding entries to the PATH is normally benign. However, if you delete, you may mess up your PATH string, and you could seriously compromise the functioning of your computer. Please be careful.
- Right-click on "My Computer" and select "Properties".
- Click Advanced -> Environment Variables.
- In the box entitled "System Variables" scroll down to the line that says "PATH" and double-click the entry.
- You will be presented with a dialog box with two text boxes, the bottom text box allows you to edit the PATH variable. It is very important that you do not delete the existing values in the PATH string, this will cause all sorts of problems for you!
- Scroll to the end of the string and at the end add ";<installation-directory>\bin". Here <installation-directory> is the full absolute path name of the installation directory; if you accepted the defaults when installing tar and gzip, then for these, it will (probably) be C:\Program Files\GnuWin32, while for MinGW it will be C:\MinGW\bin, (if you kept to the recommended default installation directory). Don't forget the semicolon; this separates the entries in the PATH.
- press OK -> OK -> OK and you are done.