qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
-
So I built Qt6.9.1 from source on Ubuntu 25.04 and compiled existing code which runs on earlier versions of the OS fine.
I have the plugin directories in the same dir as the executable (app/bin), and the app shared libs and Qt6 shared libs in (app/lib). The plugins are copied from the Qt install dir /usr/local/Qt-6.9.1/plugins; only imageformats, platforms and xcbintegrations are there. And in platforms no wayland plugins were copied.
When the app is started though, I get a message to stdout :
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""At first I thought there may be a plugin that needed a wayland lib, but checking the app and all plugins and all shared libs showed no references to wayland libs anywhere.
So I'm puzzled: why the message, and how to get rid of it?
Sure I can set an env var 'QT_QPA_PLATFORM=xcb' and the message goes away, but I'd rather not have end users having to set env vars. And I haven't found it necessary on other apps.
I should say that on Ubuntu, wayland is the default XDG_SESSION_TYPE. But I'd rather not use wayland in the app, I've found it buggy.
Also I did try setting QT_DEBUG_PLUGINS=1 but it didn't shed much light on the problem, apart from what appears to be a related to libqvnc.so:
qt.core.plugin.factoryloader: looking at "libqvnc.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqvnc.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"vnc"
]
},
"archlevel": 1,
"className": "QVncIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("vnc")
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
qt.core.library: "/home/keith/spice3f5_linux64_ub25/bin/platforms/libqxcb.so" loaded library -
So I built Qt6.9.1 from source on Ubuntu 25.04 and compiled existing code which runs on earlier versions of the OS fine.
I have the plugin directories in the same dir as the executable (app/bin), and the app shared libs and Qt6 shared libs in (app/lib). The plugins are copied from the Qt install dir /usr/local/Qt-6.9.1/plugins; only imageformats, platforms and xcbintegrations are there. And in platforms no wayland plugins were copied.
When the app is started though, I get a message to stdout :
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""At first I thought there may be a plugin that needed a wayland lib, but checking the app and all plugins and all shared libs showed no references to wayland libs anywhere.
So I'm puzzled: why the message, and how to get rid of it?
Sure I can set an env var 'QT_QPA_PLATFORM=xcb' and the message goes away, but I'd rather not have end users having to set env vars. And I haven't found it necessary on other apps.
I should say that on Ubuntu, wayland is the default XDG_SESSION_TYPE. But I'd rather not use wayland in the app, I've found it buggy.
Also I did try setting QT_DEBUG_PLUGINS=1 but it didn't shed much light on the problem, apart from what appears to be a related to libqvnc.so:
qt.core.plugin.factoryloader: looking at "libqvnc.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqvnc.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"vnc"
]
},
"archlevel": 1,
"className": "QVncIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("vnc")
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
qt.core.library: "/home/keith/spice3f5_linux64_ub25/bin/platforms/libqxcb.so" loaded library@KeithS said in qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "":
Also I did try setting QT_DEBUG_PLUGINS=1 but it didn't shed much light on the problem, apart from what appears to be a related to libqvnc.so:
What does the diagnostic log show for
wayland
rather than thevnc
stuff? Either it is not searching for it or you get some diagnostic indicating it has or cannot load it? -
It doesn't show anything for wayland apart from the section I gave above. Here's the full output:
qt.core.plugin.factoryloader: checking directory path "/home/keith/spice3f5_linux64_ub25/bin/platforms" ...
qt.core.plugin.factoryloader: looking at "libqminimal.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqminimal.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimal"
]
},
"archlevel": 1,
"className": "QMinimalIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("minimal")
qt.core.plugin.factoryloader: looking at "libqminimalegl.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqminimalegl.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimalegl"
]
},
"archlevel": 1,
"className": "QMinimalEglIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("minimalegl")
qt.core.plugin.factoryloader: looking at "libqlinuxfb.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqlinuxfb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"linuxfb"
]
},
"archlevel": 1,
"className": "QLinuxFbIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("linuxfb")
qt.core.plugin.factoryloader: looking at "libqeglfs.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqeglfs.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"eglfs"
]
},
"archlevel": 1,
"className": "QEglFSIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("eglfs")
qt.core.plugin.factoryloader: looking at "libqxcb.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqxcb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"xcb"
]
},
"archlevel": 1,
"className": "QXcbIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("xcb")
qt.core.plugin.factoryloader: looking at "libqoffscreen.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqoffscreen.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"offscreen"
]
},
"archlevel": 1,
"className": "QOffscreenIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("offscreen")
qt.core.plugin.factoryloader: looking at "libqvkkhrdisplay.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqvkkhrdisplay.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"vkkhrdisplay"
]
},
"archlevel": 1,
"className": "QVkKhrDisplayIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("vkkhrdisplay")
qt.core.plugin.factoryloader: looking at "libqvnc.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/platforms/libqvnc.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"vnc"
]
},
"archlevel": 1,
"className": "QVncIntegrationPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("vnc")
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
qt.core.library: "/home/keith/spice3f5_linux64_ub25/bin/platforms/libqxcb.so" loaded library
qt.core.plugin.factoryloader: checking directory path "/home/keith/spice3f5_linux64_ub25/bin/platformthemes" ...
qt.core.plugin.factoryloader: checking directory path "/home/keith/spice3f5_linux64_ub25/bin/platforminputcontexts" ...
qt.core.plugin.factoryloader: checking directory path "/home/keith/spice3f5_linux64_ub25/bin/styles" ...
qt.core.plugin.factoryloader: checking directory path "/home/keith/spice3f5_linux64_ub25/bin/iconengines" ...
qt.core.plugin.factoryloader: checking directory path "/home/keith/spice3f5_linux64_ub25/bin/imageformats" ...
qt.core.plugin.factoryloader: looking at "libqsvg.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/imageformats/libqsvg.so, metadata=
{
"IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
"MetaData": {
"Keys": [
"svg",
"svgz"
],
"MimeTypes": [
"image/svg+xml",
"image/svg+xml-compressed"
]
},
"archlevel": 1,
"className": "QSvgPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("svg", "svgz")
qt.core.plugin.factoryloader: looking at "libqjpeg.so"
qt.core.plugin.loader: Found metadata in lib /home/keith/spice3f5_linux64_ub25/bin/imageformats/libqjpeg.so, metadata=
{
"IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
"MetaData": {
"Keys": [
"jpg",
"jpeg",
"jfif"
],
"MimeTypes": [
"image/jpeg",
"image/jpeg",
"image/jpeg"
]
},
"archlevel": 1,
"className": "QJpegPlugin",
"debug": false,
"version": 395520
}qt.core.plugin.factoryloader: Got keys from plugin meta data QList("jpg", "jpeg", "jfif")
qt.core.library: "/home/keith/spice3f5_linux64_ub25/bin/imageformats/libqsvg.so" loaded library
qt.core.library: "/home/keith/spice3f5_linux64_ub25/bin/imageformats/libqjpeg.so" loaded library
qt.core.plugin.factoryloader: checking directory path "/home/keith/spice3f5_linux64_ub25/bin/accessible" ... -
Hi,
What exactly do you have in the platforms folder ?
-
libqeglsfs.so
libqlinuxfb.so
libqminimalegl.so
libqminimal.so
libqoffscreen.so
libqvkkhrdisplay.so
libqvnc.so
libqxcb.soBasically everything from the Qt installation plugin dir excepy wayland .so's
-
@KeithS So it means you didn't build the Wayland platform integration plugin. It is possible that when you built Qt, it was skipped in the
configure
step - because you asked it to, or because needed libwayland headers or tools were missing on the system. You should try to reconfigure your build tree - it will say in the summary at the end was was skipped and why.It is also worth to note that as of Qt 6.9, the Qt Wayland platform integration plugin is still located in a separate
qtwayland
module, not yet inqtbase
- so if you built from Git or split tarballs, you need to explicitly build it. -
Ah, I misunderstood the question - my apologies! You don't have the Wayland plugin build/installed on purpose, and don't want to use it (in my defense, people usually ask about the other way around). In that case, Qt will generally try to load and use it in first priority anyway if
XDG_SESSION_TYPE
says it is a Wayland session. That is not new behavior, and it was like that since 5.11 I believe. What may have changed for you is that for a long while Qt didn't do it on Gnome due to a large amount of issues. That bit has changed in 6.2 (see https://codereview.qt-project.org/c/qt/qtbase/+/369443) so that Gnome isn't singled out anymore - as supposedly the bad Wayland on Gnome issues have improved.It is possible that you upgraded Qt beyond that change. Anyway the message is harmless.
-
Thanks - I think something changed, either between Ubuntu 24 and 25, or Qt 6.8.0 and 6.9.1, as another machine with older versions does not show the issue. Still I guess it's cosmetic as you say, although I tend to be a bit pedantic about getting rid of unnecessary warnings/messages.