Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
Forum Updated to NodeBB v4.3 + New Features

How to deploy an application with the required QT libraries? qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""

Scheduled Pinned Locked Moved Solved Installation and Deployment
12 Posts 5 Posters 6.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • raven-worxR raven-worx

    @mbruel
    plugins are loaded by Qt itself. So you can set paths to look for plugins:
    http://doc.qt.io/qt-5/deployment-plugins.html

    LD_LIBRARY_PATH is rather for specifing linked dependency libs

    mbruelM Offline
    mbruelM Offline
    mbruel
    wrote on last edited by mbruel
    #3

    @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.html

    LD_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)

    raven-worxR jsulmJ 2 Replies Last reply
    0
    • mbruelM mbruel

      @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.html

      LD_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)

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #4

      @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)

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #5

        Hi,

        An alternative you can use is the linuxdeployqt project.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • mbruelM mbruel

          @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.html

          LD_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)

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #6

          @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

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          mbruelM 1 Reply Last reply
          0
          • jsulmJ jsulm

            @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

            mbruelM Offline
            mbruelM Offline
            mbruel
            wrote on last edited by mbruel
            #7

            @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?)
            jsulmJ 1 Reply Last reply
            0
            • mbruelM mbruel

              @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?)
              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #8

              @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.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              J.HilkJ raven-worxR 2 Replies Last reply
              0
              • jsulmJ jsulm

                @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.

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #9

                @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/13

                And also probably not the way the op would want to/should distribut Qt-libs


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                1 Reply Last reply
                0
                • jsulmJ jsulm

                  @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.

                  raven-worxR Offline
                  raven-worxR Offline
                  raven-worx
                  Moderators
                  wrote on last edited by
                  #10

                  @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.

                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                  If you have a question please use the forum so others can benefit from the solution in the future

                  jsulmJ 1 Reply Last reply
                  0
                  • raven-worxR raven-worx

                    @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.

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #11

                    @raven-worx Yes, Qt Lite.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • mbruelM Offline
                      mbruelM Offline
                      mbruel
                      wrote on last edited by
                      #12

                      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
                      
                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved