Open stdevCrow opened 5 years ago
Hey
It is ok to use the 3rd party libs bundled with Qt instead of the system ones?
Yeah, I think it's okay. (And the binding doesn't really care which ones you use anyway)
What dependencies do you usually install (besides the ones mentioned in the doc) before configure? What is your configure command?
The are quit a few deps needed for static builds of Qt under linux, especially if you want to get it working inside a docker container.
But I created a docker image some time ago, which you could use to deploy statically compiled applications for linux.
To do so just run qtdeploy -docker build linux_static
If you want to see how the image was made (and/or create your own custom docker image), then take a look at these two images:
This one builds a static Qt version: https://github.com/therecipe/qt/blob/master/internal/docker/linux/Dockerfile.static_base
And this one sets up the binding inside a docker container, so you can use the image for docker deployments with qtdeploy -docker ...
:
https://github.com/therecipe/qt/blob/master/internal/docker/linux/Dockerfile.static
After building Qt statically, how can we use it with therecipe/qt?
You usually only need to export QT_QMAKE_DIR=path/to/static/qmake/dir
and QT_STATIC=true
.
But I only tested this on linux and macOS.
For static windows builds I usually just use MXE's static Qt version and cross compile from linux to windows. (by using qtdeploy -docker build windows_64_static
)
I can take a look and see what changes would be needed to get static windows build working on windows though.
Btw, you can find the configure command to get static macOS builds of Qt working here
Thank u! I will try that.
BTW this what I do to build Qt statically on Windows. It can be improved (I will improve it), but it works 100% because I installed a Unix env and checked the dependences with ldd
, and the output was:
ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ffc685f0000)
??? => ??? (0x77400000)
wow64.dll => /c/Windows/System32/wow64.dll (0x7ffc658d0000)
wow64win.dll => /c/Windows/System32/wow64win.dll (0x7ffc68540000)
Include
, Libs
and Utilities/bin
folders (select the target architecture, x86 or x64).
NOTE: Install DirectX SDK is not a strict requirement, you can build Qt without it, but ANGLE will not be build, which is not a problem if you use OpenGL, (which is the default, anyway).Scripts
.perl/bin
, c/bin
, and perl/site/bin
.$ configure -prefix "X:/somePath/QtStatic" -static -static-runtime -release -opensource -confirm-license -nomake tools -nomake examples -nomake tests -skip qtwebengine -silent
$ mingw32-make -k -j4
$ mingw32-make -k install
Thanks, I will try to build it on Windows and see what needs to be done once I find some time.
The following issue has two targets:
1. Static compilation under Linux
2. Using the static kit with therecipe/qt
Sadly, static compilation of Qt is not so well documented, I think, so a wiki page can be useful on this topic.
1. Static compilation under Linux
I have success many times on creating static kits under Windows, but sadly not under Linux.
My Linux
configure
command:So there are a few questions:
configure
?configure
command?2. Using the static kit with therecipe/qt
After building Qt statically, how can we use it with
therecipe/qt
?The main purpose of building Qt statically in this case is because I am making a custom, simple, minimalist and lightweight installer framework because the QtIFW do not allows offline updates and making a custom UI (using
Qt Quick Controls 2
module) is very hard. And an installer must be statically compiled.