问题描述
安装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 ~/.bash