Solved How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
-
@raven-worx said in How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "":
@mbruel
plugins are loaded by Qt itself. So you can set paths to look for plugins:
http://doc.qt.io/qt-5/deployment-plugins.htmlLD_LIBRARY_PATH is rather for specifing linked dependency libs
Well how can I know which plugins are needed by my app? and thus which libraries I need to provide so the app would run on a fresh distribution that hasn't QT installed?
Other question: is it possible to install the last version of QT without QtCreator, just with the minimum libraries or even better by selecting them?
For example Debian 9.6 has only Qt5.7 and if there is a compatibility issue if my app and external libraries are compiles with the 5.11...
(I would need those packages only: libqt5core5a libqt5gui5 libqt5concurrent5 libqt5xml5 libqt5printsupport5 libqt5opengl5) -
@mbruel said in How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "":
Well how can I know which plugins are needed by my app? and thus which libraries I need to provide so the app would run on a fresh distribution that hasn't QT installed?
http://doc.qt.io/qt-5/linux-deployment.html
For plugins you will have to check each folder if you need them or not (this should be mostly self explanary if you use features of it)
-
Hi,
An alternative you can use is the linuxdeployqt project.
-
@mbruel said in How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "":
Other question: is it possible to install the last version of QT without QtCreator
Yes it is
-
@jsulm said in How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "":
Yes it is
May I ask how? When I launch the installer (qt-unified-linux-x64-3.0.5-online.run) I'm not able to unselect QtCreator. I'm not able either to only install certain librairies. (I'm only interested in libqt5core5a libqt5gui5 libqt5concurrent5 libqt5xml5 libqt5printsupport5 libqt5opengl5)
@SGaist said in How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "":
An alternative you can use is the linuxdeployqt project.
Thanks for the link, I'll have a look at it. I'm trying to kind of do the same thing manually and I'm having issues with the plugins (cf the crash above)
@raven-worx said in How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "":
For plugins you will have to check each folder if you need them or not (this should be mostly self explanary if you use features of it)
Could you detail a little the procedure please, I'm still using LD_LIBRARY_PATH and this is not working...
Do I need to add some code in C++ to load the plugins?
I've managed to make work my app with QT v5.7 by installing the libraries from the depository of the distribution (libqt5core5a libqt5gui5 libqt5concurrent5 libqt5xml5 libqt5printsupport5 libqt5opengl5). Doing that I've used the same plugins that have been installed with those package:bruel@debian:/usr/lib/x86_64-linux-gnu/qt5$ ls plugins/ bearer egldeviceintegrations generic iconengines imageformats platforminputcontexts platforms platformthemes printsupport xcbglintegrations
So I've used exactly the same for my 5.11 version:
bruel@riyad:~/Documents/release$ ls -R libs_5.11 libs_5.11: libQt5Xlsx.so.0 libQt5Xlsx.so.0.3.0 libqwt.so.6 libqwt.so.6.1.3 Qt5.11 libs_5.11/Qt5.11: libicudata.so.56 libicui18n.so.56 libicuuc.so.56 libQt5Concurrent.so.5 libQt5Gui.so.5 libQt5PrintSupport.so.5 libQt5Widgets.so.5 libQt5Xml.so.5 libicudata.so.56.1 libicui18n.so.56.1 libicuuc.so.56.1 libQt5Core.so.5 libQt5OpenGL.so.5 libQt5Svg.so.5 libQt5XcbQpa.so.5 plugins libs_5.11/Qt5.11/plugins: bearer egldeviceintegrations generic iconengines imageformats platforminputcontexts platforms platformthemes printsupport xcbglintegrations
Then for now I'm still using the LD_LIBRARY_PATH like this:
#!/bin/sh QT_511=./libs_5.11/Qt5.11 export LD_LIBRARY_PATH=$QT_511/plugins/bearer:$QT_511/plugins/egldeviceintegrations:$QT_511/plugins/generic:$QT_511/plugins/iconengines:$QT_511/plugins/imageformats:$QT_511/plugins/platforminputcontexts:$QT_511/plugins/platforms:$QT_511/plugins/platformthemes:$QT_511/plugins/printsupport:$QT_511/plugins/xcbglintegrations:$QT_511:./libs_5.11:$LD_LIBRARY_PATH
And I'm getting the same crash...
Could you give me some help on how to use QT_PLUGIN_PATH, I don't get what I should do from the doc (http://doc.qt.io/qt-5/deployment-plugins.html)PS: what would be for you the easier option for delivery? (non developers or IT people)
- Use the distribution package for the QT libraries needed (so older version like 5.7 in Debian stable) and just deliver the application compiled with that version.
- provide the QT dll we wish to use (so latest QT vesion) with the application. Can this option be more complicated in case the QT libraries we're providing miss some system dependencies?
- force to install latest QT libraries (how can we do that? without QtCreator and the whole QT dev environment?)
-
@mbruel Yes, you're right, looks like you can't unselect QtCreator.
There is a project targeting making Qt more configurable (don't remember the name). Using it you can exactly specify which parts of Qt you need, but I think you need to build Qt by yourself to do so. -
@jsulm said in How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "":
@mbruel Yes, you're right, looks like you can't unselect QtCreator.
You can force your way around it, found that out by accident:
https://forum.qt.io/topic/80086/qt-creator-4-3-0-stability/13And also probably not the way the op would want to/should distribut Qt-libs
-
@jsulm said in How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "":
There is a project targeting making Qt more configurable (don't remember the name).
You mean Qt Lite?
if so AFAIK it is only available for commercial (or even Qt for DEvice Creation). For open source there are only the the configure option to strip out unneeded features. -
@raven-worx Yes, Qt Lite.
-
For those who may need, I've finally managed to use QT_PLUGIN_PATH.
I had a missing library used by some of the plugins so they were found but not loaded.
Setting the environment variable QT_DEBUG_PLUGINS allows to found out which one.
So here is my lib folder:$ ls -R libs_5.11/ libs_5.11/: libQt5Xlsx.so.0 libQt5Xlsx.so.0.3.0 libqwt.so.6 libqwt.so.6.1.3 Qt5.11 libs_5.11/Qt5.11: libicudata.so.56 libicui18n.so.56 libicuuc.so.56 libQt5Concurrent.so.5 libQt5DBus.so.5 libQt5OpenGL.so.5 libQt5Svg.so.5 libQt5XcbQpa.so.5 plugins libicudata.so.56.1 libicui18n.so.56.1 libicuuc.so.56.1 libQt5Core.so.5 libQt5Gui.so.5 libQt5PrintSupport.so.5 libQt5Widgets.so.5 libQt5Xml.so.5 libs_5.11/Qt5.11/plugins: bearer egldeviceintegrations generic iconengines imageformats platforminputcontexts platforms platformthemes printsupport xcbglintegrations
And the script used to launch the app:
$ cat launch_MyApp_Qt5.11.sh #!/bin/sh QT_511=./libs_5.11/Qt5.11 export QT_PLUGIN_PATH=$QT_511/plugins/ #export QT_DEBUG_PLUGINS=1 export LD_LIBRARY_PATH=$QT_511:./libs_5.11:$LD_LIBRARY_PATH ./MyApp_Qt5.11