MinGW-w64's headers have been installed already, but not the rest of the project, including useful libraries. This building process will cover the rest of the MinGW-w64 project.
This may take a while to build. Feel free to do something else while this is building.
MinGW-w64-Binutils-2.45, MinGW-w64-headers-13.0.0, and Static MinGW-w64-GCC-15.2.0
Install x86_64 MinGW-w64 by running the following commands:
mkdir build-x86_64 &&
cd build-x86_64 &&
../configure --prefix=/usr/x86_64-w64-mingw32 \
--host=x86_64-w64-mingw32 \
--disable-lib32 \
--enable-experimental \
--with-default-msvcrt=msvcrt &&
make
Now, as the root user:
make install
Now build the winpthreads library after installing the bulk of MinGW-w64 to prevent the build from linking against libraries that weren't installed but now are (this library enables POSIX thread support):
cd .. &&
mkdir build-x86_64-winpthreads &&
cd build-x86_64-winpthreads &&
../mingw-w64-libraries/winpthreads/configure \
--prefix=/usr/x86_64-w64-mingw32 \
--host=x86_64-w64-mingw32 \
--disable-lib32 \
--with-default-msvcrt=msvcrt &&
make
Now install the winpthreads library as the root user:
make install && cd ..
Install i686 MinGW-w64 by running the following commands:
mkdir build-i686 &&
cd build-i686 &&
../configure --prefix=/usr/i686-w64-mingw32 \
--host=i686-w64-mingw32 \
--disable-lib64 \
--enable-experimental \
--with-default-msvcrt=msvcrt &&
make
Now, as the root user:
make install
Now build the winpthreads library after installing the bulk of MinGW-w64 to prevent the build from linking against libraries that weren't installed but now are (this library enables POSIX thread support):
cd .. &&
mkdir build-i686-winpthreads &&
cd build-i686-winpthreads &&
../mingw-w64-libraries/winpthreads/configure \
--prefix=/usr/i686-w64-mingw32 \
--host=i686-w64-mingw32 \
--disable-lib64 \
--with-default-msvcrt=msvcrt &&
make
Now install the winpthreads library as the root user:
make install
Run ../configure --help and ../mingw-w64-libraries/winpthreads/configure --help respectively for a full list of options.
--prefix=/usr/*: This
option installs the files to their respective architecture for
better separation of architectures.
--host=*: This option
builds files for the architecture passed to it.
--enable-experimental: This
option enables experimental features.
--with-default-msvcrt=msvcrt: As of
MinGW-w64-12.0.0, the Universal C
Runtime (UCRT), added in Windows 10, has become the default. This
option makes the Microsoft Visual C Runtime (MSVCRT) the default,
which is more tested and has less bugs. It also ensures
compatibility with software made for older Windows versions.