[Interest] Provide a Means to Make Static Builds of Qt 6.1 for Android, macOS, Windows and GNU/Linux

Marius Kittler mkittler at suse.de
Fri Sep 3 15:12:18 CEST 2021


> However, configuring and building Qt on Microsoft Windows on a Windows
> host with either MinGW or MSVC has been impossible.

I did it in the past and it is doable. However, I must also say that Windows 
is not my preferred platform for development. So for years I'm now conducting 
my Windows builds also on GNU/Linux, specifically Arch Linux where I maintain 
packages for cross compilation including static variants:

https://aur.archlinux.org/packages/?K=mingw-w64-qt5
https://aur.archlinux.org/packages/?K=mingw-w64-qt6

I spend some effort so static linking works also for Qt's dependencies so that 
the final executable only depends on libraries provided by Windows itself. 
However, I must also say that this kind of cross compilation is not supported 
by upstream.

> I would like to have virtual machines or Docker containers that allow
> me to build Qt statically for all prior mentioned platforms. If it's
> possible to use coin's scripts locally instead, please tell me how.

I personally just use an Arch Linux machine directly but it would of course be 
possible to use Docker (like https://github.com/mdimura/docker-mingw-arch).
Of course you can also just use the Arch PKGBUILDs as a template to create 
your own build scripts and just run them under any distribution.

There's of course also https://github.com/mxe/mxe which also allows to make a 
static Qt build. I suppose they lack Qt 6 builds, though. I'm also not sure 
whether there's a binary repository (at least provided by some community 
member).

For native compilation under Windows MSYS2 is also an option. Not sure how 
well their static variants work, though.




More information about the Interest mailing list