centos系统装上qt5之后点击桌面图标打不开

9 篇文章 0 订阅

进入到安装目录下的/home/zhe/Qt/Tools/QtCreator/lib/Qt/plugins/platforms路径
./qtcreator 出现
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.

修改bash.bashrc 在末尾一行添加
export QT_DEBUG_PLUGINS=1
然后source bash.bashrc
再次进入到安装目录下./qtcreator
出现
Got keys from plugin meta data (“xcb”)
QFactoryLoader::QFactoryLoader() checking directory path “/home/zhe/Qt/Tools/QtCreator/bin/platforms” …
Cannot load library /home/zhe/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: 无法打开共享对象文件: 没有那个文件或目录)
QLibraryPrivate::loadPlugin failed on “/home/zhe/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so” : “Cannot load library /home/zhe/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: 无法打开共享对象文件: 没有那个文件或目录)”
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.

进入/home/zhe/Qt/Tools/QtCreator/lib/Qt/plugins/platforms目录:
输入ldd libqxcb.so
找到libqxcb.so需要依赖哪些插件,发现libxcb-util.so.1 => not found
缺少libxcb-util.so.1库,
需要安装 libxcb-util1 库,但是 apt install 找不到那个库,所以干脆就把deb包给下下来安装:http://ftp.br.debian.org/debian/pool/main/x/xcb-util/libxcb-util1_0.4.0-1+b1_amd64.deb

下载下来后,安装这个deb包。sudo dpkg -i ./libxcb-util1_0.4.0-1+b1_amd64.deb

再次进入/home/zhe/Qt/Tools/QtCreator/lib/Qt/plugins/platforms 输入ldd libqxcb.so
显示已安装
点击桌面的图标可以打开了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

曾忆少年时~峥嵘岁月稠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值