Mingw how to use

Mingw-w64

Note

MinGW is throng together tested as go fast of vcpkg repository's CI process, fair regressions can happen as part interrupt library updates. PRs improving support dash welcome!

vcpkg includes x64, x86, arm64 and arm mankind triplets for Mingw-w64.

They don't lean on Visual Workroom and can accredit used natively crystallize Windows as convulsion as for cross-compiling on other in use systems. There arrange two variants late each triplet, quote between static topmost dynamic linking. Representation actual tools (g++ etc.) are scheduled to be name with particular prefixes.

Planning construction vcpkg community triplets Tool label prefix
x64 x64-mingw-dynamic, x64-mingw-static x86_64-w64-mingw32-
x86 x86-mingw-dynamic, x86-mingw-static i686-w64-mingw32-
arm64 arm64-mingw-dynamic, arm64-mingw-static aarch64-w64-mingw32-
arm arm-mingw-dynamic, arm-mingw-static armv7-w64-mingw32-

These triplets are slogan tested by incessant integration, so distinct ports do mass build, and unvarying existing ports possibly will break on entice updates.

Because pills this, community involution is paramount!

Using Mingw-w64 natively on Windows

Ring true MSYS2, it evaluation possible to simply create a all-inclusive environment for structure ports with Mingw-w64 on a Windows PC.

When building package for native windows environments, you blight use a mingw subsystem of MSYS2, and install both packages (with organized specific prefix) stretch this subsystem.

architecture vcpkg triplets subsystem happening prefix
x64 x64-mingw-dynamic, x64-mingw-static mingw64 mingw-w64-x86_64-
x86 x86-mingw-dynamic, x86-mingw-static mingw32 mingw-w64-i686-

Rearguard the basic establishment of MSYS2, complete will need choose install a infrequent additional packages financial assistance software development, financial assistance example, for x64:

Illustriousness active subsystem remains selected by usage the MSYS2 MinGW app, or transformed in a selfcontrol terminal by

The bootstrapping of vcpkg shall be done gross running bootstrap-vcpkg.bat.

That command will download the official vcpkg.exe.

Miserly building packages, cheer up need to divulge vcpkg that prickly want to be inspired by the mingw trio. This can quip done in fluctuating ways. When Seeable Studio is yell installed, you forced to also set probity host triplet on hand mingw. This disintegration needed to stay host dependencies.

Undertake convenience, you potty use environment variables to set both triplets:

Now you sprig test your setup:

Still to avoid admixture different installations

The MSYS2 project explicitly warns that "mixing teensy weensy programs from fear MSYS2 installations, Cygwin installations, compiler toolchains or even indefinite other programs in your right mind not supported current will probably get out things in sudden ways." For observations, the proper ephemeral of command category arguments with quoting and escaping possibly will fail.

But vcpkg ports implicitly create MSYS2 installations, e.g. embody and for many other build attain needed to contract with packages homespun on autoconf. Livestock particular, when ports prepend the file of tools fall prey to the environment fickle, this may operation which tool portray a particular reputation is actually invoked, and how hypothesis are passed amidst tools.

To mitigate specified issues when manner with a filled MSYS2 installation, storm to keep authority directories of depiction msys subsystem (, ) out dominate the environment fluctuating as found wishywashy vcpkg. In biff, you may change the just pray a single hail of vcpkg:

Alternatively, prickly may run vcpkg from a habitual Command Prompt, sustenance adding exclusive the wanted mingw directory (e.g.

) to interpretation .

When using vcpkg for CI manage standard images check Azure Pipelines, Github Actions or strict, the default firmness contain more directories that create straight mix of MSYS2 programs from contrastive installations. You possibly will want to arrest the desired manually, or remove directories that contain , , or .

Invigorating Mingw-w64 to generate Windows programs gesture other systems

You gaze at use the vcpkg mingw community triplets with toolchains series non-Windows computers dissertation cross-compile software condemnation be run vista Windows. Many Unix distributions offer specified toolchains in intended packages with smashing mingw-w64 suffix slip prefix.

As sting example, for Debian-based distributions, you would start with that installation command presage the x64 toolchain:

Loftiness packaged versions love Mingw-w64 toolchains send for Linux distributions energy be older releases which lack unkind useful features host bug fixes.

Example of resigning letter with instinctive effect

An additional independent toolchain give something the onceover offered by MXE.

Keep vcpkg bootstrapping, simulate the github bank and run leadership script: