Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. CPack. qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Qt 6.11 is out! See what's new in the release blog

CPack. qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 5 Posters 249 Views 1 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.
  • D Offline
    D Offline
    DungeonLords
    wrote last edited by DungeonLords
    #1

    I can run my app by name (type this in console)

    "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample"
    

    alt text
    But I want to have the app inside .deb pack so I use CPack. I can install it

    sudo dpkg -i "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
    

    And call my app

    $ /opt/myapp/bin/myexample
    qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
    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) /opt/myapp/bin/myexample
    

    I tried to apply tricks with LD_LIBRARY_PATH without success

    $ LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
    qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
    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) LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
    

    How to open my app from .deb?

    This is what inside my .deb

    $ dpkg-deb -c "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
    

    61c61c13-a7e9-4d38-85a0-66608872e813-image.png

    This is my repo (copy). I use last Qt version from git dev branch

    $ git log --oneline -1
    e5a39cd6 (HEAD -> dev, origin/dev, origin/HEAD) Fix icu provisioning for Debian 11
    
    JonBJ Grit ClefG 2 Replies Last reply
    0
    • D DungeonLords

      I can run my app by name (type this in console)

      "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample"
      

      alt text
      But I want to have the app inside .deb pack so I use CPack. I can install it

      sudo dpkg -i "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
      

      And call my app

      $ /opt/myapp/bin/myexample
      qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
      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) /opt/myapp/bin/myexample
      

      I tried to apply tricks with LD_LIBRARY_PATH without success

      $ LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
      qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
      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) LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
      

      How to open my app from .deb?

      This is what inside my .deb

      $ dpkg-deb -c "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
      

      61c61c13-a7e9-4d38-85a0-66608872e813-image.png

      This is my repo (copy). I use last Qt version from git dev branch

      $ git log --oneline -1
      e5a39cd6 (HEAD -> dev, origin/dev, origin/HEAD) Fix icu provisioning for Debian 11
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote last edited by
      #2

      @DungeonLords
      I don't know anything about your situation with "app"s and "deb packs". But for further diagnostics as to where exactly Qt is looking for what when it issues those "Could not find the Qt platform plugin" messages you might get some extra information if you first

      export QT_DEBUG_PLUGINS=1
      

      in the shell before running your program.

      D 1 Reply Last reply
      0
      • JonBJ JonB

        @DungeonLords
        I don't know anything about your situation with "app"s and "deb packs". But for further diagnostics as to where exactly Qt is looking for what when it issues those "Could not find the Qt platform plugin" messages you might get some extra information if you first

        export QT_DEBUG_PLUGINS=1
        

        in the shell before running your program.

        D Offline
        D Offline
        DungeonLords
        wrote last edited by
        #3

        @JonB this doesn't add any new message. Or probably I use this wrong way?

        SGaistS 1 Reply Last reply
        0
        • D DungeonLords

          @JonB this doesn't add any new message. Or probably I use this wrong way?

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote last edited by
          #4

          @DungeonLords said in CPack. qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "":

          @JonB this doesn't add any new message. Or probably I use this wrong way?

          Hi,

          How exactly are you using it ?

          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
          • H Offline
            H Offline
            herman21
            Banned
            wrote last edited by
            #5

            This looks more like a Qt deployment issue than a CPack problem itself. The reason it works from your build directory is probably because Qt can still see the plugin folders there. But once installed from the .deb, it no longer knows where the wayland and xcb platform plugins are located.
            The key part is: Could not find the Qt platform plugin "wayland" in ""
            That empty path usually means no Qt plugin path is being picked up at runtime. So even though your libraries may exist under /opt/myapp/lib, the actual Qt plugin directories (platforms/, Wayland plugins, xcb plugins, etc.) are probably missing from the package or not being referenced correctly.
            a lot of people avoid packaging Qt manually with CPack for exactly this reason and use tools like linuxdeployqt, because it automatically bundles the required Qt plugins and fixes paths.

            1 Reply Last reply
            0
            • D DungeonLords

              I can run my app by name (type this in console)

              "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample"
              

              alt text
              But I want to have the app inside .deb pack so I use CPack. I can install it

              sudo dpkg -i "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
              

              And call my app

              $ /opt/myapp/bin/myexample
              qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
              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) /opt/myapp/bin/myexample
              

              I tried to apply tricks with LD_LIBRARY_PATH without success

              $ LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
              qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
              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) LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
              

              How to open my app from .deb?

              This is what inside my .deb

              $ dpkg-deb -c "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
              

              61c61c13-a7e9-4d38-85a0-66608872e813-image.png

              This is my repo (copy). I use last Qt version from git dev branch

              $ git log --oneline -1
              e5a39cd6 (HEAD -> dev, origin/dev, origin/HEAD) Fix icu provisioning for Debian 11
              
              Grit ClefG Offline
              Grit ClefG Offline
              Grit Clef
              wrote last edited by
              #6

              @DungeonLords said in CPack. qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "":

              I can run my app by name (type this in console)

              "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample"
              

              alt text
              But I want to have the app inside .deb pack so I use CPack. I can install it

              sudo dpkg -i "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
              

              And call my app

              $ /opt/myapp/bin/myexample
              qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
              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) /opt/myapp/bin/myexample
              

              I tried to apply tricks with LD_LIBRARY_PATH without success

              $ LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
              qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
              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) LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
              

              How to open my app from .deb?

              This is what inside my .deb

              $ dpkg-deb -c "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
              

              61c61c13-a7e9-4d38-85a0-66608872e813-image.png

              This is my repo (copy). I use last Qt version from git dev branch

              $ git log --oneline -1
              e5a39cd6 (HEAD -> dev, origin/dev, origin/HEAD) Fix icu provisioning for Debian 11
              

              @DungeonLords said in CPack. qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "":

              I can run my app by name (type this in console)

              "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample"
              

              alt text
              But I want to have the app inside .deb pack so I use CPack. I can install it

              sudo dpkg -i "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
              

              And call my app

              $ /opt/myapp/bin/myexample
              qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
              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) /opt/myapp/bin/myexample
              

              I tried to apply tricks with LD_LIBRARY_PATH without success

              $ LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
              qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
              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) LD_LIBRARY_PATH="/opt/myapp/lib/" /opt/myapp/bin/myexample
              

              How to open my app from .deb?

              This is what inside my .deb

              $ dpkg-deb -c "$HOME/Ubuntu_Wayland_Build_Qt_widgets/example/build-host/myexample-0.1.2-Linux.deb"
              

              61c61c13-a7e9-4d38-85a0-66608872e813-image.png

              This is my repo (copy). I use last Qt version from git dev branch

              $ git log --oneline -1
              e5a39cd6 (HEAD -> dev, origin/dev, origin/HEAD) Fix icu provisioning for Debian 11
              

              From your picture I see there're truly no platform plugins. Usually they are under /opt/myapp/plugins/platforms but I didn't see that directory?

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

                You might also want to check the Qt cmake deployment guide.

                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

                • Login

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