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. qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 5 Posters 142 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.
  • K Offline
    K Offline
    KeithS
    wrote last edited by
    #1

    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

    JonBJ 1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote last edited by
      #2

      you can try to set QT_QPA_PLATFORM=xcb in your main() with
      qputenv( "QT_QPA_PLATFORM","xcb" );
      before call
      QApplication app(argc, argv);

      1 Reply Last reply
      0
      • K Offline
        K Offline
        KeithS
        wrote last edited by
        #3

        You are right, I can, but it should not be necessary. I have another Qt6 app running on the same machine, and that doesn't complain about wayland. So far I can't see any obvious reason why it should be different.

        1 Reply Last reply
        0
        • K KeithS

          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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote last edited by
          #4

          @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 the vnc stuff? Either it is not searching for it or you get some diagnostic indicating it has or cannot load it?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            KeithS
            wrote last edited by
            #5

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

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

              Hi,

              What exactly do you have in the platforms folder ?

              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
              • K Offline
                K Offline
                KeithS
                wrote last edited by
                #7

                libqeglsfs.so
                libqlinuxfb.so
                libqminimalegl.so
                libqminimal.so
                libqoffscreen.so
                libqvkkhrdisplay.so
                libqvnc.so
                libqxcb.so

                Basically everything from the Qt installation plugin dir excepy wayland .so's

                1 Reply Last reply
                0
                • I Offline
                  I Offline
                  IgKh
                  wrote last edited by IgKh
                  #8

                  @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 in qtbase - so if you built from Git or split tarballs, you need to explicitly build it.

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    KeithS
                    wrote last edited by
                    #9

                    No, I did build wayland as part of Qt, if you read what I wrote carefully - I just didn't copy wayland plugins to the app's dir.

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      IgKh
                      wrote last edited by IgKh
                      #10

                      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.

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        KeithS
                        wrote last edited by
                        #11

                        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.

                        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