A valid MSY2 environment needs to be installed prior to follow these instructions. The steps to install it can be found on this link Installing the MSYS2 Enviroment.
To install Qy5 in MSYS2 firs your need to launch a msys2 shell by executing the file
c:\msys64\msys2_shell.cmd. Then execute the next command to install the prebuilt version of Qt5.
$pacman -S mingw-w64-x86_64-qt-creator
Also if you need the static library version, install it by executing the next command.
$pacman -S mingw-w64-x86_64-qt5-static
To install the 32bit version just replace
Note : In order to use the static version, the User PATH variables should have the next entries in the exact order, to allow the compiler find the static libraries first.
C:\msys64\mingw64\qt5_static; C:\msys64\mingw64\bin; C:\msys64\usr\local\bin; C:\msys64\usr\bin;
If you attempt to build a program in debug mode against the static library, get prepared to get an executable with a size over 200Mb.