Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.4.2, 6.7.0 RC
-
None
-
-
c7176f314 (dev)
Description
I am building Qt statically. For debugging, I needed to run qtdiag. Running qtdiag failed with:
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Aborted (core dumped)
This happens because the platform plugins are built statically but have not been linked statically into qtdiag.
I did grep for qt_import_plugins in order to see whether at least some of the tools are linked correctly during static builds. I found that qhelpgenerator does call it. I have copy-pasted the code from qt-everywhere-src-6.4.2/qttools/src/assistant/qhelpgenerator/CMakeLists.txt into qt-everywhere-src-6.4.2/qttools/src/qtdiag/CMakeLists.txt and adjusted it as required.
I have attached a patch created with diff -u. I have also attached the EasyBuild recipe that I am currently working on. It contains all configure options.
Imho, this large chunk of code should be a CMake macro and then should be called for all executable targets to make them work when Qt is compiled with -static.
Attachments
For Gerrit Dashboard: QTBUG-111988 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
560333,1 | Fix the static linking of plugins to the Qt tools and internal executables | 6.7 | qt/qtbase | Status: NEW | +2 | 0 |
551780,18 | Fix the static linking of plugins to the Qt tools and internal executables | dev | qt/qtbase | Status: MERGED | +2 | 0 |