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

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.



  • Im running an ubuntu 20.04.1 on a windows machine through windows-linux-subsytem (version 2), i was trying to run gambas3, but i had some issues:

    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
    loaded library "**/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so**"
    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.
    
    Aborted
    

    I read the forum and i found similar problems, so i tried to reinstall libxcb, but i got this:

    ~$ sudo apt-get install libxcb
    [sudo] password for <user>:
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package libxcb
    
    ~$ sudo apt-get --reinstall install libxcb
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package libxcb
    

    I made an ldd:

    ~$ ldd /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so
            linux-vdso.so.1 (0x00007ffe58fe9000)
            libQt5XcbQpa.so.5 => /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5 (0x00007f26f13b3000)
            libQt5Gui.so.5 => /lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f26f0dc8000)
            libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f26f087f000)
            libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f26f069e000)
            libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f26f04ac000)
            libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f26f0465000)
            libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f26f03a4000)
            libQt5DBus.so.5 => /lib/x86_64-linux-gnu/libQt5DBus.so.5 (0x00007f26f0308000)
            libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f26f02e5000)
            libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f26f02e0000)
            libxcb-xinput.so.0 => /lib/x86_64-linux-gnu/libxcb-xinput.so.0 (0x00007f26f02bc000)
            libxcb-icccm.so.4 => /lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007f26f02b5000)
            libxcb-image.so.0 => /lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007f26f00ae000)
            libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f26f00a9000)
            libxcb-keysyms.so.1 => /lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007f26f00a4000)
            libxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007f26f0091000)
            libxcb-render-util.so.0 => /lib/x86_64-linux-gnu/libxcb-render-util.so.0 (0x00007f26f008a000)
            libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f26f007b000)
            libxcb-shape.so.0 => /lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007f26f0074000)
            libxcb-sync.so.1 => /lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f26f006a000)
            libxcb-xfixes.so.0 => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007f26f0060000)
            libxcb-xinerama.so.0 => /lib/x86_64-linux-gnu/libxcb-xinerama.so.0 (0x00007f26f005b000)
            libxcb-xkb.so.1 => /lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007f26f003d000)
            libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f26f0013000)
            libXrender.so.1 => /lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f26efe07000)
            libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f26efcca000)
            libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f26efb7b000)
            libSM.so.6 => /lib/x86_64-linux-gnu/libSM.so.6 (0x00007f26efb70000)
            libICE.so.6 => /lib/x86_64-linux-gnu/libICE.so.6 (0x00007f26efb52000)
            libxkbcommon-x11.so.0 => /lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 (0x00007f26efb47000)
            libxkbcommon.so.0 => /lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007f26efb03000)
            libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f26ef9da000)
            libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f26ef9bf000)
            libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007f26ef937000)
            libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f26ef8ff000)
            libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f26ef8e1000)
            libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f26ef7dc000)
            libicui18n.so.66 => /lib/x86_64-linux-gnu/libicui18n.so.66 (0x00007f26ef4dd000)
            libicuuc.so.66 => /lib/x86_64-linux-gnu/libicuuc.so.66 (0x00007f26ef2f7000)
            libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f26ef2f1000)
            libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007f26ef26e000)
            libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007f26ef256000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f26f155f000)
            libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f26ef228000)
            libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f26ef21f000)
            libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f26ef1ce000)
            libxcb-util.so.1 => /lib/x86_64-linux-gnu/libxcb-util.so.1 (0x00007f26eefc8000)
            libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f26eefc0000)
            libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f26eefb8000)
            libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f26eef9e000)
            libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f26eef2b000)
            libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f26eee73000)
            libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f26eee3d000)
            libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f26eee10000)
            libicudata.so.66 => /lib/x86_64-linux-gnu/libicudata.so.66 (0x00007f26ed34f000)
            libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f26ed2a0000)
            librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f26ed295000)
            liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f26ed26a000)
            liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f26ed249000)
            libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f26ed12b000)
            libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f26ed108000)
    

    I look for the specific package:

    ~$ apt-file find libqxcb.so
    libqt5gui5: /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so
    libqt5gui5-gles: /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so
    nsight-compute: /usr/lib/nsight-compute/host/linux-desktop-glibc_2_11_3-x64/Plugins/platforms/libqxcb.so
    nsight-systems: /usr/lib/nsight-systems/Host-x86_64/Plugins/platforms/libqxcb.so
    

    I guess i have it, but i wonder why i cant install it?



  • @gjoe said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:

    qt.qpa.xcb: could not connect to display

    It looks like you don't have an X server running.
    See this article for instance about WLS2, specifically the section "Run GUI applications in WSL with X11 Forwarding"



  • @gjoe said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:

    qt.qpa.xcb: could not connect to display

    This is your problem. The library is found and loads.



  • What do you think i should do to resolve my problem?

    I was trying to emulate a graphical application (gambas) with vcxsrv server.

    ~$ gambas3
    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.
    
    Aborted
    


  • @gjoe said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:

    qt.qpa.xcb: could not connect to display

    It looks like you don't have an X server running.
    See this article for instance about WLS2, specifically the section "Run GUI applications in WSL with X11 Forwarding"



  • I finally made it.
    I followed the instructions and run gambas3 with PuTTY's prompt.

    1.png

    I still wonder why i couldn't run x11 server directly with ubuntu 20.04.1 wls2 but i guess it doesn't matter right now.

    Thank you for you support.


Log in to reply