Qt 5.5.1 找不到 libQt5XcbQpa.so.5

Qt 5.5.1 cannot find libQt5XcbQpa.so.5

我在我的虚拟机上使用 Qt 5.5.1 Creator (Ubuntu 12.04.5 LTS),以及带有触摸屏的 Beaglebone black。当我编写 gui 应用程序(只有一个 window 带有按钮)并尝试部署它时,我收到此错误:

This application failed to start because it could not find or load the Qt platform plugin "xcb"

Reinstalling the application may fix this problem. bash: line 1: 907 Aborted DISPLAY=':0.0' /opt/proba/Test/Test Application finished with exit code 134.

我在网上搜索,发现这个问题在某种程度上与 libqxcb.so 库有关,我尝试了 ldd libxcb.so 命令,结果是:

linux-vdso.so.1 (0xbef5a000)

libQt5XcbQpa.so.5 => not found

libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6f67000)

libX11-xcb.so.1 => /usr/lib/arm-linux-gnueabihf/libX11-xcb.so.1 (0xb6f55000)

libXi.so.6 => /usr/lib/arm-linux-gnueabihf/libXi.so.6 (0xb6f3b000)

libxcb-render-util.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-render-util.so.0 (0xb6f30000)

libSM.so.6 => /usr/lib/arm-linux-gnueabihf/libSM.so.6 (0xb6f1a000)

libICE.so.6 => /usr/lib/arm-linux-gnueabihf/libICE.so.6 (0xb6ef7000)

libxcb-render.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-render.so.0 (0xb6ee0000)

libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb6ebb000)

libxcb-image.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-image.so.0 (0xb6ea7000)

libxcb-icccm.so.4 => /usr/lib/arm-linux-gnueabihf/libxcb-icccm.so.4 (0xb6e9b000)

libxcb-sync.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb-sync.so.1 (0xb6e85000)

libxcb-xfixes.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-xfixes.so.0 (0xb6e70000)

libxcb-shm.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-shm.so.0 (0xb6e5d000)

libxcb-randr.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-randr.so.0 (0xb6e44000)

etc...

如您所见,libQt5XcbQpa.so.5 未找到,即使这 库存在于我保存库的部分程序中:

-rw------- 1 debian debian 1140 Feb 9 2016 libQt5XcbQpa.la

-rw------- 1 debian debian 1478 Feb 9 2016 libQt5XcbQpa.prl

lrwxrwxrwx 1 debian debian 21 Mar 1 12:34 libQt5XcbQpa.so -> libQt5XcbQpa.so.5.5.1

lrwxrwxrwx 1 debian debian 21 Mar 1 12:34 libQt5XcbQpa.so.5 -> libQt5XcbQpa.so.5.5.1

lrwxrwxrwx 1 debian debian 21 Mar 1 12:34 libQt5XcbQpa.so.5.5 -> libQt5XcbQpa.so.5.5.1

-rw------- 1 debian debian 602768 Feb 9 2016 libQt5XcbQpa.so.5.5.1

任何人都可以告诉我如何解决这个问题,而且当我启动我的应用程序时它会打开终端。

抱歉我的英语不好。

您的应用程序需要 libqxcm.so,这需要 libQt5XcmQpa.so.5libQt5DBus.so.5libQt5Gui.so.5libQt5Core.so.5

libqxcm.so 将在您的应用程序目录中的目录 platforms 中。

不要忘记为共享库创建符号链接,如下所示:

libQt5Core.so.5 -> libQt5Core.so.5.5.1
libQt5Gui.so.5 -> libQt5Gui.so.5.5.1
libQt5XcmQpa.so.5 -> libQt5XcmQpa.so.5.5.1
libQt5DBus.so.5 -> libQt5DBus.so.5.5.1

有关详细答案,请查看此答案: