“无法加载平台插件“xcb""在未安装 qt 的情况下在 linux 上启动 qt5 应用程序时 [英] "Failed to load platform plugin "xcb" " while launching qt5 app on linux without qt installed

查看:95
本文介绍了“无法加载平台插件“xcb""在未安装 qt 的情况下在 linux 上启动 qt5 应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为使用 Qt5 的 linux 编写了应用程序.

I wrote application for linux which uses Qt5.

但是当我尝试在没有安装 Qt SDK 的 linux 上启动它时,控制台中的输出是:

But when I am trying to launch it on the linux without Qt SDK installed, the output in console is:

无法加载平台插件xcb".可用平台有:

Failed to load platform plugin "xcb". Available platforms are:

我该如何解决这个问题?我可能需要复制一些插件文件吗?当我在安装了 Qt5 的情况下使用 ubuntu,但我重命名 Qt 目录时,也会出现同样的问题.因此,它使用 Qt 目录中的一些文件...

How can I fix this? May be I need to copy some plugin file? When I use ubuntu with Qt5 installed, but I rename Qt directory, the same problem occurs. So, it uses some file from Qt directory...

更新:当我使用文件 libqxcb.so 在应用程序目录平台"文件夹中创建时,应用程序仍然无法启动,但错误消息发生了变化:

UPDATE: when I create in the app dir "platforms" folder with the file libqxcb.so, the app still doesnot start, but the error message changes:

无法加载平台插件xcb".可用平台有:

Failed to load platform plugin "xcb". Available platforms are:

xcb

怎么会这样?平台插件可用但加载不出来怎么办?

How can this happen? How can platform plugin be available but can't be loaded?

推荐答案

使用 ldd (man ldd) 显示共享库依赖项.在 libqxcb.so 上运行它

Use ldd (man ldd) to show shared library dependencies. Running this on libqxcb.so

.../platforms$ ldd libqxcb.so

表明除了 libQt5Core.so.5 和 libQt5Gui.so.5(以及许多其他系统库)之外,xcb 还依赖于 libQt5DBus.so.5.将 libQt5DBus.so.5 添加到您的共享库集合中,您应该准备好继续前进了.

shows that xcb depends on libQt5DBus.so.5 in addition to libQt5Core.so.5 and libQt5Gui.so.5 (and many other system libs). Add libQt5DBus.so.5 to your collection of shared libs and you should be ready to move on.

这篇关于“无法加载平台插件“xcb""在未安装 qt 的情况下在 linux 上启动 qt5 应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆