set up MSYS2 on windows
install MSYS2
- Go to msys2.org and download msys2-x86_64-20190524.exe
- After installed, MSYS2 is avaliable at C:\msys64\usr\bin\mintty.exe
post-install MSYS2
- first, update system at the first time start up
pacman -Syu - after finish, close(NOT Ctrl+c) the window and reopen again
- update again
pacman -Sy pacman -Syu - (optional) add host environment variable C:\msys64\mingw64\bin to PATH
install toolchain in MSYS2
pacman -S mingw-w64-x86_64-toolchain make
- shadow gcc
echo "alias gcc=\"x86_64-w64-mingw32-gcc\"" >> ~/.bashrc