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. qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "/usr/lib/x86_64-linux-gnu/qt6/plugins/platforms" even though it was found
QtWS25 Last Chance

qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "/usr/lib/x86_64-linux-gnu/qt6/plugins/platforms" even though it was found

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
13 Posts 4 Posters 198 Views
  • 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.
  • R Offline
    R Offline
    Remnant
    wrote last edited by
    #1

    Hello,

    I have a problem with my qt installation in which in this post I tried installing qt with a static build with a conan package and I finally managed to link the plugin. Now I am getting this error message:

    qt.core.library: "/usr/lib/x86_64-linux-gnu/qt6/plugins/platforms/libqwayland-generic.so" loaded library
    QObject::moveToThread: Current thread (0x56b15c0bcc30) is not the object's thread (0x56b15c0f4940).
    Cannot move to target thread (0x56b15c0bcc30)
    
    qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "/usr/lib/x86_64-linux-gnu/qt6/plugins/platforms" even though it was found.
    

    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

    I have run ldd and did not find any dependencies missing in the two .so wayland-generic.so and wayland-egl.so. I am a little stumped. Would you have any suggestions of things I can try to get it to work? I have found some wizardry in some forums where they move a libQt6WaylandClient.so into the platforms but I would probably like to know if there is a simpler and better fix ? Thank you for your answers

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Remnant
      wrote last edited by Remnant
      #2

      If I try to run it with xcb I get

      qt.core.library: "/usr/lib/x86_64-linux-gnu/qt6/plugins/platforms/libqxcb.so" loaded library
      QObject::moveToThread: Current thread (0x5bc0a3cc4c30) is not the object's thread (0x5bc0a3d023c0).
      Cannot move to target thread (0x5bc0a3cc4c30)
      
      qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
      qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/lib/x86_64-linux-gnu/qt6/plugins/platforms" even though it was found.
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
      

      but when I look at ldd libqxcb libxcb-cursor0 does not appear as a dependency and grepping for found I don't get anything

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

        Hi,

        You can start your application with the QT_DEBUG_PLUGINS environment variable set to 1 to get more information about what is happening.

        That said, why does your static Qt build try to load your system installed plugins ?

        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
        2
        • R Offline
          R Offline
          Remnant
          wrote last edited by
          #4

          HI,
          I am already running that flag. And for the static question I had the same question, I guess it is because it must be hard to make the app crossplatform otherwise,

          one of the lines

          t.core.plugin.factoryloader: ignoring "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3" since plugins are disabled in static builds
          
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote last edited by
            #5

            No, there's something wrong. A static build of Qt might use system libraries such as xcb but should not load the plugins from an installed version of Qt

            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
            1
            • R Offline
              R Offline
              Remnant
              wrote last edited by
              #6

              Yes except that it is a really comon error, is it not possible that Qt plugins are not portable enough to be bundled in the static build?

              SGaistS 1 Reply Last reply
              0
              • R Offline
                R Offline
                Remnant
                wrote last edited by Remnant
                #7

                and would you have any paths to try and fix the problem please? :) (I have tried running the executable as sudo still no luck)

                JoeCFDJ 1 Reply Last reply
                0
                • R Remnant

                  and would you have any paths to try and fix the problem please? :) (I have tried running the executable as sudo still no luck)

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote last edited by
                  #8

                  @Remnant it is likely that some dependencies of the plugin are not installed. plugin is a lib as well. run command:
                  ldd path/plugin.so
                  to check if some dependencies are missing. or
                  strace your app
                  to find out what is missing.

                  R 1 Reply Last reply
                  0
                  • R Remnant

                    Yes except that it is a really comon error, is it not possible that Qt plugins are not portable enough to be bundled in the static build?

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

                    @Remnant the only dynamic dependencies of a static Qt build should be the system libraries such as xcb or the SQL client libraries. The Qt plugins themselves shall be static otherwise. Hence it looks like there's something off with that build of yours. Or your application build did not pick the correct plugins.

                    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
                    1
                    • JoeCFDJ JoeCFD

                      @Remnant it is likely that some dependencies of the plugin are not installed. plugin is a lib as well. run command:
                      ldd path/plugin.so
                      to check if some dependencies are missing. or
                      strace your app
                      to find out what is missing.

                      R Offline
                      R Offline
                      Remnant
                      wrote last edited by Remnant
                      #10

                      @JoeCFD I have tried that and I think you are right there is a whole bunch of file calls not hitting.
                      Okay so I tried to paste my output but Akismet.com won't let me. But according to their website they have 99.99% accuracy so I'll trust them.

                      openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/lib/glibc-hwcaps/x86-64-v4/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                      openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/lib/glibc-hwcaps/x86-64-v3/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                      openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/lib/glibc-hwcaps/x86-64-v2/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                      openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                      openat(AT_FDCWD, "/home/username/.conan2/p/b/zlibf508e02f60bc4/p/lib/glibc-hwcaps/x86-64-v4/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                      openat(AT_FDCWD, "/home/username/.conan2/p/b/zlibf508e02f60bc4/p/lib/glibc-hwcaps/x86-64-v3/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                      openat(AT_FDCWD, "/home/username/.conan2/p/b/zlibf508e02f60bc4/p/lib/glibc-hwcaps/x86-64-v2/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                      

                      I do not know if these calls are mandatory though I do not know if somebody knows whether they are?
                      There is an another 232 lines like that. But the gist is that glibc is missing from conan

                      1 Reply Last reply
                      0
                      • hskoglundH Online
                        hskoglundH Online
                        hskoglund
                        wrote last edited by
                        #11

                        The missing glibc error I think is a red herring, those plugin errors probably occur because you have 2 QApplication instances (one static and one dynamic in a separate thread), i.e. your static build might be incomplete so that Qt resorts to dynamic linking to load the missing pieces.

                        R 1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          Remnant
                          wrote last edited by
                          #12

                          Oh and plugins are missing shall I go and ask the question on qt recipe issues?

                          openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/imageformats/glibc-hwcaps/x86-64-v4/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                          openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/imageformats/glibc-hwcaps/x86-64-v3/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                          openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/imageformats/glibc-hwcaps/x86-64-v2/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                          openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/imageformats/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                          openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/platforms/glibc-hwcaps/x86-64-v4/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                          

                          + some more output like that which I cannot post

                          1 Reply Last reply
                          0
                          • hskoglundH hskoglund

                            The missing glibc error I think is a red herring, those plugin errors probably occur because you have 2 QApplication instances (one static and one dynamic in a separate thread), i.e. your static build might be incomplete so that Qt resorts to dynamic linking to load the missing pieces.

                            R Offline
                            R Offline
                            Remnant
                            wrote last edited by Remnant
                            #13

                            @hskoglund Yes I think that is right, but then I just don't know which library are essential in the creation of the static build for wayland.

                            openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/platforms/glibc-hwcaps/x86-64-v4/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                            openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/platforms/glibc-hwcaps/x86-64-v3/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                            openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/platforms/glibc-hwcaps/x86-64-v2/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                            openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/platforms/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                            openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/sqldrivers/glibc-hwcaps/x86-64-v4/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                            openat(AT_FDCWD, "/home/username/.conan2/p/b/qt9e43eba220521/p/plugins/sqldrivers/glibc-hwcaps/x86-64-v3/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                            

                            There are two more lines of sqldrivers missing

                            This is the rest of the output, is there one of the libs that are critical?

                            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