QtCreator 不启动 "could not load platform xcb" [Ubuntu 16.04]

QtCreator does not start "could not load platform xcb" [Ubuntu 16.04]

我使用安装工具 "qt-unified-linux-x64-3.0.5-online.run" 安装了 Qt5.7 包括 Qtcreator 到文件夹 /usr/local/Qt

当我 运行 qtcreator 处于详细模式时(导出 QT_DEBUG_PLUGINS=1),我得到以下输出:

Cannot load library /usr/local/Qt/5.7/gcc_64/plugins/platforms/libqxcb.so: (/usr/local/Qt/5.7/gcc_64/lib/libQt5XcbQpa.so.5: symbol _ZTI18QPlatformClipboard, version Qt_5 not defined in file libQt5Gui.so.5 with link time reference)
QLibraryPrivate::loadPlugin failed on "/usr/local/Qt/5.7/gcc_64/plugins/platforms/libqxcb.so" : "Cannot load library /usr/local/Qt/5.7/gcc_64/plugins/platforms/libqxcb.so: (/usr/local/Qt/5.7/gcc_64/lib/libQt5XcbQpa.so.5: symbol _ZTI18QPlatformClipboard, version Qt_5 not defined in file libQt5Gui.so.5 with link time reference)"
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, xcb, vnc.

运行 ldd /usr/local/Qt/5.7/gcc_64/plugins/platforms/libqxcb.so returns

linux-vdso.so.1 =>  (0x00007ffdda390000)
libQt5XcbQpa.so.5 => /usr/local/Qt/5.7/gcc_64/lib/libQt5XcbQpa.so.5 (0x00007f9e44a33000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f9e44831000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f9e44621000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f9e44419000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f9e441ff000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f9e43fb3000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f9e43d91000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9e43b8d000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f9e4398b000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9e43783000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f9e43472000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f9e43268000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f9e43056000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f9e42d1c000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f9e42ad9000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f9e4282f000)
libEGL.so.1 => /usr/lib/nvidia-384/libEGL.so.1 (0x00007f9e4262a000)
libQt5Gui.so.5 => /usr/local/Qt/5.7/gcc_64/lib/libQt5Gui.so.5 (0x00007f9e41e9e000)
libQt5DBus.so.5 => /usr/local/Qt/5.7/gcc_64/lib/libQt5DBus.so.5 (0x00007f9e41c1e000)
libQt5Core.so.5 => /usr/local/Qt/5.7/gcc_64/lib/libQt5Core.so.5 (0x00007f9e41500000)
libGL.so.1 => /usr/lib/nvidia-384/libGL.so.1 (0x00007f9e411be000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9e40fa1000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9e40c1f000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9e40916000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9e40700000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9e40336000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f9e40131000)
libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f9e450fc000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f9e3ff2d000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f9e3fd27000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9e44f84000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9e3fab7000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f9e3f88e000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9e3f674000)
libpng12.so.0 => /usr/lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f9e3f44f000)
libGLdispatch.so.0 => /usr/lib/nvidia-384/libGLdispatch.so.0 (0x00007f9e3f181000)
libicui18n.so.56 => /usr/local/Qt/5.7/gcc_64/lib/libicui18n.so.56 (0x00007f9e3ece7000)
libicuuc.so.56 => /usr/local/Qt/5.7/gcc_64/lib/libicuuc.so.56 (0x00007f9e3e92f000)
libicudata.so.56 => /usr/local/Qt/5.7/gcc_64/lib/libicudata.so.56 (0x00007f9e3cf4c000)
libnvidia-tls.so.384.130 => /usr/lib/nvidia-384/tls/libnvidia-tls.so.384.130 (0x00007f9e3cd48000)
libnvidia-glcore.so.384.130 => /usr/lib/nvidia-384/libnvidia-glcore.so.384.130 (0x00007f9e3ae8c000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f9e3ac6a000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f9e3aa48000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f9e3a767000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f9e3a553000)

我无法确定错误。相关线程例如 https://forum.qt.io/topic/71369/failed-to-load-qt-platform-plugin-xcb/2,但 libQt5XcbQpa.so.5.6.1 在我的案例中并没有丢失。有什么想法吗?

我的解决方案是使用以下方法明确指向正确的共享库: LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/qtcreator

我运行进入问题Ubuntu16,错误xcb。使用详细键,我意识到缺少包:libxcb-xinerama0。安装后,一切正常。