Some of the instructions here are out of date, as MSYS2 has changed since this was written.
This page describes how to use MSYS2, which provides an extremely useful and up-to-date MSYS/MinGW system, although it lacks instructions of how it should actually be used.
First, you must install the base system - pick either i686 (32 bit) or x86_64 (64 bit) from the Base repository.
For example, choose msys2-base-i686-20131208.tar.xz for the 32 bit version.
Once downloaded, extract it to a location of your choice (e.g C:/mingw), but it is strongly advised to avoid a path that contains spaces. Use something like 7-zip to extract the tarball.
Once extracted, double click on one of the batch files (e.g mingw32_shell.bat) - depending on what system you wish to start. On the first run, you may have to close and restart the shell if it prompts you to do so.
The base system only contains essential files for the MSYS2 system. You will need to install extra packages for anything else, such as running MinGW.
MSYS2 ships with a package manager, pacman
, which allows for easy installation of packages.
For example, to install make
, run:
pacman -S make
To find packages by name, type:
pacman -Ss query-string
To update the package list, run:
pacman -Sy
To update all packages, run:
pacman -Syu
For a full list of commands, see the pacman documentation
The list of repositories that pacman uses is stored in /etc/pacman.conf
By default, the MinGW repository is not added. Adding this repository allows you to access the MinGW-w64 toolchain and other precompiled libraries. To do so, edit /etc/pacman.conf
by adding the following lines to the end of the file:
[mingw32] Server = https://sourceforge.net/projects/msys2/files/REPOS/MINGW/$arch
Then update the backage list, as above (pacman -Sy
)