qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in ““ even though it was found.

本文讲述了在Ubuntu环境下安装Qt后遇到CouldnotloadtheQtplatformpluginxcb错误,提供了通过更新包libxcb-cursor0、设置QT_DEBUG_PLUGINS环境变量以及参考外部资源来解决问题的详细步骤。
摘要由CSDN通过智能技术生成

关于Ubuntu端,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: minimalegl, vkkhrdisplay, linuxfb, eglfs, vnc, offscreen, xcb, wayland-egl, minimal, wayland.

如果是以上错误,执行以下命令

sudo apt update
sudo apt-get install libxcb-cursor0

这个命令的作用是安装名为libxcb-cursor0的软件包。这个软件包通常是与XCB(X protocol C-language Binding)库相关的。

然后重新启动qt,看是否正常打开。

如果还没解决:

执行命令:

export QT_DEBUG_PLUGINS=1

这个环境变量用于调试Qt插件加载过程中的问题。将其设置为1会让Qt在加载插件时输出更多调试信息,有助于诊断插件加载失败或出现其他问题的情况。

重新启动qt,查看报错信息。

之后的步骤可以看这位博主的文章

http://t.csdnimg.cn/KwMba

希望你早日解决这个问题

  • 12
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值