Skip to content

Install MinGW 64 and MSYS on Microsoft Windows

MMGen edited this page Jan 14, 2018 · 4 revisions

MinGW-64 (Minimal GNU for Windows) provides the gcc compiler and related tools for compiling source code into Windows binaries. MSYS provides a Unix-like environment under Windows with basic commands and utilities. MinGW-64 and MSYS were originally part of the same project and are designed to be used together.

Download the latest MSYS zip archive and MinGW-64 7-zip archive provided by the MinGW-64 team. To unpack the latter you'll need the program 7-zip.

After unzipping both archives to C:\ (assuming that's the root of your filesystem), you'll have two new directory trees at C:\msys and C:\mingw64.

Open Power Shell and type the command C:\msys\bin\bash.exe --login to launch your MSYS environment.

To avoid having to type this command by hand each time you enter MSYS, you're advised to create a launcher icon. Copy the “PowerShell” icon, rename the copy to “MSYS”, right click on the icon, and add the above command to the end of the existing command line after a space.

Note: This version of MSYS comes with the Vim editor preinstalled. If you're an experienced Vim user or have read the primer and feel you know what you're doing, then proceed onward. Otherwise, you should install an easier-to use text editor before continuing with the installation.

Execute the command

mkdir -p /c/mingw620/x86_64-620-posix-seh-rt_v5-rev1/mingw64

Using your text editor within MSYS, create the file /etc/fstab.conf with the following two lines:

c:/mingw64 /mingw
c:/mingw64 /c/mingw620/x86_64-620-posix-seh-rt_v5-rev1/mingw64

Execute the command mount /mingw

MSYS is a Unix-like environment. If you're new to Unix, you're advised to learn a few basic commands.

Clone this wiki locally
You can’t perform that action at this time.