MinGW-w64-13.0.0

#### Gaming Linux® From Scratch - Version 13.0

### Chapter 20. The MinGW-w64 Toolchain

- Prev

  Static MinGW-w64-GCC-15.2.0

- Next

  MinGW-w64-GCC-15.2.0

- Up
- Home

# MinGW-w64-13.0.0

## Introduction to MinGW-w64

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.

### Note

This may take a while to build. Feel free to do something else while this is building.

- Download: https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v13.0.0.tar.bz2

### MinGW-w64 Dependencies

Required
MinGW-w64-Binutils-2.46, MinGW-w64-headers-13.0.0, and Static MinGW-w64-GCC-15.2.0

## Installation of MinGW-w64

### x86_64 MinGW-w64

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 ..

### i686 MinGW-w64

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

## Command Explanations

### Note

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.

## Contents

Installed Programs: None
Installed Libraries: libwinpthread-1 (DLL; in /usr/{i686,x86_64}-w64-mingw32/bin) and hundreds of static libraries and headers needed by Windows. To see the whole list of libraries, visit https://archlinux.org/packages/extra/any/mingw-w64-crt/, and see "Package Contents".
Installed Directories: /usr/{i686,x86_64}-w64-mingw32/{bin,lib}

- Prev

  Static MinGW-w64-GCC-15.2.0

- Next

  MinGW-w64-GCC-15.2.0

- Up
- Home