问题描述
安装Qt5.15.0后,在运行测试用例时弹出错误:
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.
Aborted (core dumped)
根据问题描述,虽然能够找到但是不能加载Qt平台插件“xcb”,虽然接下来又说重新安装可能能够解决,这个可能的话,还是尽量作为最下的选择吧。
定位问题
修改配置文件~/.bashrc:
$ vim ~/.bashrc
在最末尾添加如下语句,会在qtcreator启动时,列出详细的错误提示。
export QT_DEBUG_PLUGINS=1
如下:
保存退出编辑,使配置文件生效:
$ source ~/.bashrc
启动qtcreator会弹出如下详细错误信息:
在打印的错误信息的最下面,找到了引发错误的真正原因:
也就是Qt动态链接库的问题,当加载libqxcb.so库的时候,还需要加载libxcb-xinerama库。
切换到报错libxcb.so所在目录:
#替换为自己的报错目录 $ cd /home/brainiac/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/
运行ldd libqxcb.so,查看关联内容:
$ ldd libqxcb.so
发现不存在libxcb-xinerama.so.0库。
解决方法
安装libxcb-xinerama库:
#如果还存在其他依赖库没有安装,也一并安装。 $ sudo apt-get install libxcb-xinerama0
安装完成后,再次查看关联内容,发现已经修复问题:
$ ldd libqxcb.so
再次运行qt程序,就可以正常运行了。
后记
又可以愉快的coding了。
总结
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 群星《歌手2024 第4期》[FLAC/分轨][563.76MB]
- RiffKitten-ChaosParade(2024)[24-44,1]FLAC
- RuneKlakegg-Nattevandrer(2024)[24-96]\FLAC
- 赖冰霞.2006-金嗓典藏辑2IN1(南方金点系列)2CD【南方】【WAV+CUE】
- 群星.1988-国语金曲尽精英VOL.2【瑞成】【WAV+CUE】
- 张宇.1999-雨一直下【EMI百代】【WAV+CUE】
- 袁娅维.2021-月亮失眠了(DELUXE)【华纳】【FLAC分轨】
- AlanBroadbent-JazzFunk(2024)[24-44,1]
- 梅艳芳《绝代芳华》开盘母带[低速原抓WAV+CUE]
- ABC唱片-《外国精逊母带直刻神奇黑胶[APE+CUE].
- 群星《天赐的声音第五季 第6期》[320K/MP3][101.43MB]
- 群星《天赐的声音第五季 第6期》[FLAC/分轨][526.16MB]
- 群星《说唱梦工厂 第2期》[320K/MP3][96.37MB]
- 杨宗宪.1994-留你留袂着【有容唱片】【WAV+CUE】
- 李翊君.2005-勇敢的爱【创意唱片】【WAV+CUE】