Could not find or load the Qt platform plugin "xcb".



  • When I run my program, I got this error.

    This application failed to start because it could not find or load the Qt platform plugin "xcb"
    in "".
    
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
    
    Reinstalling the application may fix this problem.
    

    I had searched for it, but thosesolutions , like use export , can not fix that.
    If I use ldd, I got this:

    ran@ran:~$ ldd /home/ran/Qt5.9.1/5.9.1/gcc_64/plugins/platforms/libqxcb.so 
    /home/ran/Qt5.9.1/5.9.1/gcc_64/plugins/platforms/libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: version `Qt_5_PRIVATE_API' not found (required by /home/ran/Qt5.9.1/5.9.1/gcc_64/plugins/platforms/libqxcb.so)
    /home/ran/Qt5.9.1/5.9.1/gcc_64/plugins/platforms/libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5_PRIVATE_API' not found (required by /home/ran/Qt5.9.1/5.9.1/gcc_64/plugins/platforms/libqxcb.so)
    /home/ran/Qt5.9.1/5.9.1/gcc_64/plugins/platforms/libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.9' not found (required by /home/ran/Qt5.9.1/5.9.1/gcc_64/plugins/platforms/libqxcb.so)
    /home/ran/Qt5.9.1/5.9.1/gcc_64/plugins/platforms/libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by /home/ran/Qt5.9.1/5.9.1/gcc_64/plugins/platforms/libqxcb.so)
    	linux-vdso.so.1 =>  (0x00007ffd06fc2000)
    	libQt5XcbQpa.so.5 => /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5 (0x00007ff34e79a000)
    	libQt5DBus.so.5 => /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5 (0x00007ff34e71b000)
    	libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007ff34e519000)
    	libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007ff34e208000)
    	libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007ff34dfc4000)
    	libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007ff34dd1a000)
    	libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007ff34d7d2000)
    	libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007ff34d2fb000)
    	libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007ff34d062000)
    	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff34ce45000)
    	libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007ff34cb0a000)
    	libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007ff34c908000)
    	libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007ff34c6f8000)
    	libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007ff34c4ef000)
    	libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007ff34c2d5000)
    	libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007ff34c0b3000)
    	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff34bd30000)
    	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff34ba27000)
    	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff34b811000)
    	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff34b446000)
    	libxcb-render-util.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render-util.so.0 (0x00007ff34b242000)
    	libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007ff34b038000)
    	libxcb-image.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007ff34ae32000)
    	libxcb-icccm.so.4 => /usr/lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007ff34ac2d000)
    	libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007ff34aa26000)
    	libxcb-xfixes.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007ff34a81d000)
    	libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007ff34a619000)
    	libxcb-randr.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007ff34a40b000)
    	libxcb-shape.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007ff34a206000)
    	libxcb-keysyms.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007ff34a003000)
    	libxcb-xkb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007ff349de8000)
    	libxkbcommon-x11.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 (0x00007ff349bdf000)
    	libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007ff3499a0000)
    	libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007ff349753000)
    	libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ff3494e3000)
    	libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007ff3492ba000)
    	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff34909f000)
    	libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007ff348e7a000)
    	libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007ff348c1c000)
    	libicui18n.so.55 => /usr/lib/x86_64-linux-gnu/libicui18n.so.55 (0x00007ff3487b9000)
    	libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007ff348425000)
    	libpcre16.so.3 => /usr/lib/x86_64-linux-gnu/libpcre16.so.3 (0x00007ff3481bf000)
    	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff347fba000)
    	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff347db2000)
    	/lib64/ld-linux-x86-64.so.2 (0x000055c18e376000)
    	libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007ff347baf000)
    	libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007ff3479ab000)
    	libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007ff3477a8000)
    	libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007ff347577000)
    	libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007ff347364000)
    	libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007ff347161000)
    	libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007ff346f5b000)
    	libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007ff346d41000)
    	libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007ff346b3c000)
    	libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007ff346936000)
    	libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007ff346724000)
    	libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007ff34651f000)
    	libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007ff34631a000)
    	libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007ff346114000)
    	libxcb-util.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-util.so.1 (0x00007ff345f0d000)
    	libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007ff345e88000)
    	libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007ff345c61000)
    	libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007ff3441aa000)
    	libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007ff343f87000)
    	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007ff343d65000)
    	libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007ff343a84000)
    	libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007ff34386f000)
    

    Can any one help me. Thanks.

    Now I have just found out that if I use a caffe model in this program, I will get this error. But hours ago, this program could run properly.



  • Hi, seems you have 2 different versions of Qt installed, 5.9.1 in /home/ran and an older version (maybe 5.5.1?) in /usr/lib/x86_64-linux-gnu. And the older version bullies the newer.

    You could try upgrading your 5.9.1 to 5.11.1, I think it's more resilient to multiple versions of Qt installed on the same Linux system.



  • @hskoglund Thinks, I will try it later.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.