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

时间:2023-03-09 01:25:13
This application failed to start because it could not find or load the Qt platform plugin "xcb".

linux根据系统Qt5未安装编译的程序Qt在该系统下进行下面的错误会报:

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



Reinstalling the application may fix this problem.

出现这个错误,主要是由于qt5为了在多平台下更方便移植。使用了一种新的技术-----platform abstraction system (QPA),而它中的库又依赖于Qt5中的一个库文件libQt5DBus.so.5,所以。仅仅要打包时仅仅要加上这个文件就能够了。

linux下qt5程序打包过程例如以下

1、把下面7个库文件放到/usr/lib文件夹下

libQt5Widgets.so.5

    libQt5Gui.so.5

    libQt5Core.so.5

    libicui18n.so.51

    libicuuc.so.51

    libicudata.so.51

libQt5DBus.so.5

2、拷贝Qt5安装文件夹中的platforms文件夹,使它和你的Qt程序同级文件夹

如今你能够双击你的程序执行了呵呵

版权声明:本文博客原创文章,博客,未经同意,不得转载。