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
项也是如此。一般情况下就可以正常启动了。