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
-
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
-
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
-
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 ?
-
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
-
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
-
and would you have any paths to try and fix the problem please? :) (I have tried running the executable as sudo still no luck)
-
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?
@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.
-
@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.@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 -
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.
-
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
-
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.
@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?