ubuntu16.04安装`Qt5`出现错误:qt.qpa.plugin: Could not load the Qt platform plugin “xcb“... it was found

ubuntu16.04系统安装Qt5出现错误:qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.

系统环境:Ubuntu16.04

1、安装Qt时出现如下错误:

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, vnc, xcb.

2、进入qt安装界面,如:../Qt5.12./Tools/QtCreator/bin/ 点击打开终端输入命令运行./qtcreator运行qt,查看报错信息。

如下所示:

在这里插入图片描述

进入相应缺乏动态库的路径:/Tools/Qtcreator/lib/Qt/plugins/platforms/ 并且使用ls查看发现有想用的动态库。

在这里插入图片描述

3、解决方法:

(1)一般情况下在终端中输入命令:sudo apt-get install --reinstall libxcb-xinerama0即可解决。

在这里插入图片描述

(2)如果(1)还是无法启动Qt,则尝试使用下面的方法:

在终端中使用命令:ldd libqxcb.so查看动态库的依赖。

在这里插入图片描述

在列表中寻找not found项,如:

在这里插入图片描述

然后在终端中输入命令进行重新下载,如:sudo apt install libxcb-xinerama.so.0 其他的not found项也是如此。一般情况下就可以正常启动了。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值