It worked perfectly on a fresh installation of MSYS2(latest build on their website).
I think users should be also informed to follow the instructions on the msys2 website to update the base packages and install some tools for compiling(just in case they overlook these three steps):
pacman -Syu
pacman -Su
pacman -S --needed base-devel mingw-w64-x86_64-toolchain