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

本文介绍了解决Qt5程序在Linux环境下因缺少Qtplatform plugin 'xcb'而导致无法启动的问题。通过将特定的7个库文件放置到/usr/lib目录下,并复制Qt5的platforms文件夹至Qt程序同级目录,可以成功运行程序。

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程序同级文件夹

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




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

转载于:https://www.cnblogs.com/lcchuguo/p/4630227.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值