'Qt Ui Tools' and 'Qt Designer' modules seem to be missing from my statically built Qt libraries
-
I’m new to Qt and my knowledge is very patchy. I’m trying to build a Qt Creator project with a statically built version of the Qt libraries that I’ve just created. After 1-2 days of trial and error, the statically built Qt libraries build fine, but unfortunately, my projects don’t build with them because they use some modules that Qt Creator seems unable to find in the statically built Qt libraries. What step have I missed? My projects build successfully with the standard dynamically linked Qt libraries.
The statically built Qt Libraries were built on Ubuntu 19.10 with version 5.12.4 of the Qt source. These are the options I selected when configuring the build …
./configure -static -release -prefix “./512-static”As far as I know, I downloaded all the necessary dependencies using, in amongst other calls, the call to …
sudo apt-get build-dep qt5-defaultWithin Qt Creator, I’ve referenced the statically built libraries in the projects using a new version and created clones of my Kit, which I’ve modified to use these new versions. The projects build fine with the old kits (using the dynamic Qt libraries) and don’t build with the new kits (using the static libraries).
The Qt Creator projects fail because they are unable to find a couple of modules: 'Qt Ui Tools' and 'Qt Designer'.
One project has this in it’s pro file …
greaterThan(QT_MAJOR_VERSION, 4) { QT += designer } else { CONFIG += designer }The other project file has this in it’s pro file …
QT += core gui uitoolsAs a test I’ve removed these lines from the project file and tried to build. I get compile errors where the corresponding headers are not found. Presumably, this shows that these modules are not included in the statically built Qt libraries.
What steps am I missing? I’d ideally like to have my projects compile to a single executable, but failing that a small number of binaries would be OK.
-
Hi and welcome to devnet,
Did you check that the qttools module was built ?
Side question, are you aware of the constraints of using a static build of Qt under GPL/LGPL ?
-
Thanks @SGaist for the help. Regarding the constraints of using static linking, I presume the code would need to be open source, or is it more involved than that?
Regarding qttools, I can’t find anything indicating a qttools library has been built when I search using the following:
find . -iname \*qttools\*This only finds the project file and folder.
I also notice in config.log a test has failed. Presumably, this isn’t normal …
looking for library libresourceqt5 Trying source 0 (type pkgConfig) of library libresourceqt5 ... + /usr/bin/pkg-config --exists --silence-errors libresourceqt5 pkg-config did not find package. => source produced no result. test config.qtmultimedia_multimedia.libraries.libresourceqt5 FAILED executing config test libclang Cannot find libclang's main header file, candidate: /usr/lib/llvm-9/include/clang-c/Index.h. test config.qttools_qdoc.tests.libclang FAILEDThe reason why I’m questioning whether this is normal or not is because I can see quite a few test failures in this file. Some because of missing headers and some because they appear to relate to windows functionality.
Are there some more dev packages that I still need to install? For instance, I can see from the logs above that the build is looking for the folder /usr/lib/llvm-9/include/clang-c/, but within the folder usr/lib/llvm-9/include I can only see the following ...
drwxr-xr-x 4 root root 4096 May 5 09:19 . drwxr-xr-x 7 root root 4096 May 5 09:19 .. lrwxrwxrwx 1 root root 28 Oct 3 2019 llvm -> ../../../include/llvm-9/llvm lrwxrwxrwx 1 root root 32 Oct 3 2019 llvm-c -> ../../../include/llvm-c-9/llvm-c drwxr-xr-x 2 root root 4096 May 5 09:19 openmp drwxr-xr-x 6 root root 4096 May 5 09:19 polly -
The LGPL constraints of a static build is that you have to provide the build artifacts for the released versions of your applications so your users may change the Qt version you are using by their own (it's also valid for other LGPL dependencies) and whatever patches you may have applied to Qt. In addition, GPL mandates that your code also becomes GPL and thus must be given when asked for.
-
Sorry, I didn't understand the explanation of the LGPL constraints. If my aim is to statically link the Qt libraries into the same executable, how can a user modify the Qt version without going back to the original source. Surely, it would be more straightforward for me to just make the source available, as in GPL. Are you saying that I would need to provide the individual object files, so they can link the executable from that?
Do you have any suggestions on how I can proceed solving the problem with what appears to be the missing qttools module in the static build, please. Thanks.
-
Sorry, I didn't understand the explanation of the LGPL constraints. If my aim is to statically link the Qt libraries into the same executable, how can a user modify the Qt version without going back to the original source. Surely, it would be more straightforward for me to just make the source available, as in GPL. Are you saying that I would need to provide the individual object files, so they can link the executable from that?
Do you have any suggestions on how I can proceed solving the problem with what appears to be the missing qttools module in the static build, please. Thanks.
@Rick-P said in 'Qt Ui Tools' and 'Qt Designer' modules seem to be missing from my statically built Qt libraries:
Are you saying that I would need to provide the individual object files, so they can link the executable from that?
Yes, to allow users to replace Qt with their own version you would need to provide build artefacts (object files).
But if you're open to make your app open source then there is no need to bother, just provide the source code. -
Try manually building the module but use an out of source build for that.