MinGW and MSYS

11 December 2019 Link



Overview

To compile stuff on windows I am using the MSYS2 distrubution of Minimalistic GNU (MinGW).

Installation

To install this do the following steps:
  1. Go to the home page https://www.msys2.org/
  2. Download msys2-i686-YYYYMMDD.exe package if your windows machine is 32 bit otherwise download msys2-x84_64-YYYYMMDD.exe if you windows machine is 64 bit.
  3. Run the downloaded exe file. It will install MSYS2 and then start the command line.
  4. On the command line run
    > pacman -Syu
  5. After it is done and gives the message to terminate the shell. Terminate the shell without returning to the prompt.
  6. Reopen MSYS2 command line Start->All Programs->MSYS2 64 bit/32 bit-> MSYS2 MSYS
  7. Keep running pacman -Syuu again and again until it says nothing to do.
  8. Now install the following packages:
    > pacman -S base-devel msys2-devel mingw-w64-x86_64-toolchain mingw-w64-i686-toolchain
    If your system is 32 bits then don't do mingw-w64-x86_64-toolchain
  9. Keep running pacman -Syuu again and again until it says nothing to do.

Usage

To compile stuff

  • To compile 32 bit applications use C:\msys64\mingw32.exe
  • To compile 64 bit applications use C:\msys64\mingw64.exe

To manage packages


References

  • Very good article about MinGW, MSYS and CYGWIN differences here and offline