Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

CLion with WSL try to run QT application (xcb can not be loaded)



  • I am trying to run the code from here https://github.com/vt4a2h/uml-tool and I found myself stuck with this error message:

    qt.qpa.xcb: could not connect to display 
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 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.
    
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
    

    I am using windows 10 with WSL 2 (Ubuntu 20.04.2 LTS)

    What I've tried:

    • sudo apt-get install -y xserver-xorg xinit
    • sudo apt-get install -y mesa-utils libegl1-mesa libegl1-mesa-dev libgbm-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
    • /etc/X11/xorg.conf ---> -bash: /etc/X11/xorg.conf: No such file or directory
    • sudo Xorg -configure
    X.Org X Server 1.20.9
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 4.15.0-130-generic x86_64 Ubuntu
    Current Operating System: Linux NB-CJ-U4-5336 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64
    Kernel command line: initrd=\initrd.img panic=-1 pty.legacy_count=0 nr_cpus=12
    Build Date: 17 January 2021  09:13:31AM
    xorg-server 2:1.20.9-2ubuntu1.2~20.04.1 (For technical support please see http://www.ubuntu.com/support)
    Current version of pixman: 0.38.4
           Before reporting problems, check http://wiki.x.org
           to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
           (++) from command line, (!!) notice, (II) informational,
           (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Tue Mar 16 17:32:21 2021
    List of video drivers:
           amdgpu
           ati
           intel
           nouveau
           qxl
           radeon
           vmware
           modesetting
           fbdev
           vesa
    No devices to configure.  Configuration failed.
    (EE) Server terminated with error (2). Closing log file.
    
    • sudo apt-get install --reinstall libxcb-xinerama0
    • export QT_DEBUG_PLUGINS=1

    I've also tried to add the following into the environment:

    QT_DEBUG_PLUGINS=1
    QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/
    XAUTHORITY=~/.Xauthority
    

    And my new error message is:

    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "eglfs"
            ]
        },
        "archreq": 0,
        "className": "QEglFSIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "linuxfb"
            ]
        },
        "archreq": 0,
        "className": "QLinuxFbIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 0,
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimalegl"
            ]
        },
        "archreq": 0,
        "className": "QMinimalEglIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 0,
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "vnc"
            ]
        },
        "archreq": 0,
        "className": "QVncIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "xcb"
            ]
        },
        "archreq": 0,
        "className": "QXcbIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/mnt/c/MyPrograms/uml-tool/cmake-build-debug" ...
    QFactoryLoader::QFactoryLoader() looking at "/mnt/c/MyPrograms/uml-tool/cmake-build-debug/cmake_install.cmake"
    QElfParser: '/mnt/c/MyPrograms/uml-tool/cmake-build-debug/cmake_install.cmake' is not an ELF object
    "'/mnt/c/MyPrograms/uml-tool/cmake-build-debug/cmake_install.cmake' is not an ELF object" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "/mnt/c/MyPrograms/uml-tool/cmake-build-debug/CMakeCache.txt"
    QElfParser: '/mnt/c/MyPrograms/uml-tool/cmake-build-debug/CMakeCache.txt' is not an ELF object
    "'/mnt/c/MyPrograms/uml-tool/cmake-build-debug/CMakeCache.txt' is not an ELF object" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "/mnt/c/MyPrograms/uml-tool/cmake-build-debug/Makefile"
    QElfParser: '/mnt/c/MyPrograms/uml-tool/cmake-build-debug/Makefile' is not an ELF object
    "'/mnt/c/MyPrograms/uml-tool/cmake-build-debug/Makefile' is not an ELF object" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "/mnt/c/MyPrograms/uml-tool/cmake-build-debug/uml-tool"
    "Failed to extract plugin meta data from '/mnt/c/MyPrograms/uml-tool/cmake-build-debug/uml-tool'" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "/mnt/c/MyPrograms/uml-tool/cmake-build-debug/UmlTool.cbp"
    QElfParser: '/mnt/c/MyPrograms/uml-tool/cmake-build-debug/UmlTool.cbp' is not an ELF object
    "'/mnt/c/MyPrograms/uml-tool/cmake-build-debug/UmlTool.cbp' is not an ELF object" 
             not a plugin
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/platforms/libqeglfs.so"
    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/platforms/libqlinuxfb.so"
    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/platforms/libqminimal.so"
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/platforms/libqminimalegl.so"
    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/platforms/libqoffscreen.so"
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/platforms/libqvnc.so"
    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/platforms/libqxcb.so"
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so"
    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so"
    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so"
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so"
    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so"
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so"
    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/mnt/c/MyPrograms/uml-tool/cmake-build-debug/platforms" ...
    loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
    qt.qpa.xcb: could not connect to display 
    qt.qpa.xcb: could not connect to display 
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/lib/x86_64-linux-gnu/qt5/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.
    
    Available platform plugins are: eglfs (from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/), linuxfb (from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/), minimal (from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/), minimalegl (from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/), offscreen (from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/), vnc (from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/), xcb (from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/), eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
    
    
    Process finished with exit code 134
    

    All of the commands from above were run from ubuntu console

    What should I do? How can I fix this?


Log in to reply