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

Could not load the Qt platform plugin "xcb" in "" problem.



  • Hi.
    I'm trying to configure a cross-compilator for Raspberry Pi 4. I made it working once with Qt 5.12.6 but recently I needed to update it to Qt 5.15 so I followed the steps from here: https://github.com/UvinduW/Cross-Compiling-Qt-for-Raspberry-Pi-4.
    When trying to run the example app "qopenglwidget" (step 6), I get error:

    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    Failed to move cursor on screen DSI1: -13
    Segmentation fault
    
    

    I tried sudo apt install libxcb-xinerama0, cause it solved the problem for some but it didn't change anything. I already updated Qt from 5.12.6 to 5.15 on another raspberry following the same tutorial and everything is working fine there so no clue why it doesn't work this time.

    Thanks.


  • Moderators

    @Piotrrr
    run ldd on QTDIR/plugins/platforms/libqxcb.so
    and install the packages of all missing dependencies.



  • @Piotrrr
    Try @raven-worx's ldd. If still stuck, export QT_DEBUG_PLUGINS=1 and then run your app for further diagnostic information.



  • Thanks for the reply.
    Output of ldd /usr/local/qt5.15/plugins/platforms/libqxcb.so:

    linux-vdso.so.1 (0xbee48000)
    	/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6f99000)
    	libQt5XcbQpa.so.5 => /usr/local/qt5.15/plugins/platforms/../../lib/libQt5XcbQpa.so.5 (0xb6e97000)
    	libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6e2f000)
    	libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb6d8c000)
    	libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb6d61000)
    	libQt5Gui.so.5 => /usr/local/qt5.15/plugins/platforms/../../lib/libQt5Gui.so.5 (0xb68bc000)
    	libQt5DBus.so.5 => /usr/local/qt5.15/plugins/platforms/../../lib/libQt5DBus.so.5 (0xb684a000)
    	libQt5Core.so.5 => /usr/local/qt5.15/plugins/platforms/../../lib/libQt5Core.so.5 (0xb640f000)
    	libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 (0xb63f0000)
    	libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb63c6000)
    	libX11-xcb.so.1 => /usr/lib/arm-linux-gnueabihf/libX11-xcb.so.1 (0xb63b4000)
    	libxcb-icccm.so.4 => /usr/lib/arm-linux-gnueabihf/libxcb-icccm.so.4 (0xb63a0000)
    	libxcb-image.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-image.so.0 (0xb638c000)
    	libxcb-shm.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-shm.so.0 (0xb6379000)
    	libxcb-keysyms.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb-keysyms.so.1 (0xb6366000)
    	libxcb-randr.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-randr.so.0 (0xb6349000)
    	libxcb-render-util.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-render-util.so.0 (0xb6335000)
    	libxcb-render.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-render.so.0 (0xb631a000)
    	libxcb-shape.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-shape.so.0 (0xb6307000)
    	libxcb-sync.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb-sync.so.1 (0xb62f1000)
    	libxcb-xfixes.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-xfixes.so.0 (0xb62da000)
    	libxcb-xinerama.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-xinerama.so.0 (0xb62c7000)
    	libxcb-xkb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb-xkb.so.1 (0xb62a2000)
    	libxcb-xinput.so.0 => not found
    	libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb6273000)
    	libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb6254000)
    	libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6132000)
    	libxkbcommon.so.0 => /usr/lib/arm-linux-gnueabihf/libxkbcommon.so.0 (0xb60e9000)
    	libxkbcommon-x11.so.0 => /usr/lib/arm-linux-gnueabihf/libxkbcommon-x11.so.0 (0xb60d2000)
    	libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb60bf000)
    	libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb5f78000)
    	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb5ef6000)
    	libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb5ec9000)
    	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb5d7b000)
    	libxcb-xinput.so.0 => not found
    	libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0xb5d69000)
    	libglib-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb5c59000)
    	libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb5c18000)
    	libuuid.so.1 => /lib/arm-linux-gnueabihf/libuuid.so.1 (0xb5c01000)
    	/lib/ld-linux-armhf.so.3 (0xb6fc1000)
    	libpng16.so.16 => /usr/lib/arm-linux-gnueabihf/libpng16.so.16 (0xb5bc5000)
    	libharfbuzz.so.0 => /usr/lib/arm-linux-gnueabihf/libharfbuzz.so.0 (0xb5ac7000)
    	libdbus-1.so.3 => /lib/arm-linux-gnueabihf/libdbus-1.so.3 (0xb5a76000)
    	libdouble-conversion.so.1 => /usr/lib/arm-linux-gnueabihf/libdouble-conversion.so.1 (0xb5a52000)
    	libicui18n.so.63 => /usr/lib/arm-linux-gnueabihf/libicui18n.so.63 (0xb5804000)
    	libicuuc.so.63 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.63 (0xb567e000)
    	libicudata.so.63 => /usr/lib/arm-linux-gnueabihf/libicudata.so.63 (0xb3c80000)
    	libpcre2-16.so.0 => /usr/lib/arm-linux-gnueabihf/libpcre2-16.so.0 (0xb3c04000)
    	libGLdispatch.so.0 => /usr/lib/arm-linux-gnueabihf/libGLdispatch.so.0 (0xb3b85000)
    	libxcb-util.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-util.so.0 (0xb3b70000)
    	libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb3b5d000)
    	libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb3b48000)
    	libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb3ad1000)
    	libgraphite2.so.3 => /usr/lib/arm-linux-gnueabihf/libgraphite2.so.3 (0xb3aa0000)
    	libsystemd.so.0 => /lib/arm-linux-gnueabihf/libsystemd.so.0 (0xb3a03000)
    	libbsd.so.0 => /usr/lib/arm-linux-gnueabihf/libbsd.so.0 (0xb39db000)
    	librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb39c4000)
    	liblzma.so.5 => /lib/arm-linux-gnueabihf/liblzma.so.5 (0xb3993000)
    	liblz4.so.1 => /usr/lib/arm-linux-gnueabihf/liblz4.so.1 (0xb3967000)
    	libgcrypt.so.20 => /lib/arm-linux-gnueabihf/libgcrypt.so.20 (0xb388d000)
    	libgpg-error.so.0 => /lib/arm-linux-gnueabihf/libgpg-error.so.0 (0xb3863000)
    

  • Lifetime Qt Champion

    @Piotrrr said in Could not load the Qt platform plugin "xcb" in "" problem.:

    libxcb-xinput.so.0 => not found

    this lib is not there



  • Run the app with export QT_DEBUG_PLUGINS=1 and I got this:

    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/home/pi/platforms" ...
    Cannot load library /usr/local/qt5.15/plugins/platforms/libqxcb.so: (libxcb-xinput.so.0: cannot open shared object file: No such file or directory)
    QLibraryPrivate::loadPlugin failed on "/usr/local/qt5.15/plugins/platforms/libqxcb.so" : "Cannot load library /usr/local/qt5.15/plugins/platforms/libqxcb.so: (libxcb-xinput.so.0: cannot open shared object file: No such file or directory)"
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    

    So it's looking for this file in /home/pi/platforms but that directory doesn't exist, am I right? Where can I get/install this libxcb-xinput.so.0 from?


  • Lifetime Qt Champion

    @Piotrrr said in Could not load the Qt platform plugin "xcb" in "" problem.:

    Where can I get/install this libxcb-xinput.so.0 from?

    What OS is running on your device?
    If Raspbian then it should be libxcb-xinput package.



  • I installed it with apt-get install libxcb-xinput-dev and now the example app works.

    Thanks all for the help.



  • @Piotrrr said in Could not load the Qt platform plugin "xcb" in "" problem.:

    now the example app works

    great, so please don't forget to mark your post as solved!


Log in to reply