欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Ubuntu18.04下解決Qt出現(xiàn)qt.qpa.plugin:Could not load the Qt platform plugin “xcb“問題

 更新時(shí)間:2020年08月11日 09:39:48   作者:盼小輝丶  
這篇文章主要介紹了Ubuntu18.04下解決Qt出現(xiàn)qt.qpa.plugin:Could not load the Qt platform plugin “xcb“問題,本文給大家分享解決方案,需要的朋友可以參考下

問題描述

安裝Qt5.15.0后,在運(yùn)行測(cè)試用例時(shí)彈出錯(cuò)誤:

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)

根據(jù)問題描述,雖然能夠找到但是不能加載Qt平臺(tái)插件“xcb”,雖然接下來又說重新安裝可能能夠解決,這個(gè)可能的話,還是盡量作為最下的選擇吧。

定位問題

修改配置文件~/.bashrc:

$ vim ~/.bashrc

在最末尾添加如下語句,會(huì)在qtcreator啟動(dòng)時(shí),列出詳細(xì)的錯(cuò)誤提示。

export QT_DEBUG_PLUGINS=1

如下:

修改配置文件

保存退出編輯,使配置文件生效:

$ source ~/.bashrc

啟動(dòng)qtcreator會(huì)彈出如下詳細(xì)錯(cuò)誤信息:

詳細(xì)錯(cuò)誤信息

在打印的錯(cuò)誤信息的最下面,找到了引發(fā)錯(cuò)誤的真正原因:

引發(fā)錯(cuò)誤的真正原因

也就是Qt動(dòng)態(tài)鏈接庫(kù)的問題,當(dāng)加載libqxcb.so庫(kù)的時(shí)候,還需要加載libxcb-xinerama庫(kù)。
切換到報(bào)錯(cuò)libxcb.so所在目錄:

#替換為自己的報(bào)錯(cuò)目錄
$ cd /home/brainiac/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/

運(yùn)行l(wèi)dd libqxcb.so,查看關(guān)聯(lián)內(nèi)容:

$ ldd libqxcb.so

查看依賴關(guān)系

發(fā)現(xiàn)不存在libxcb-xinerama.so.0庫(kù)。

解決方法

安裝libxcb-xinerama庫(kù):

#如果還存在其他依賴庫(kù)沒有安裝,也一并安裝。
$ sudo apt-get install libxcb-xinerama0

安裝完成后,再次查看關(guān)聯(lián)內(nèi)容,發(fā)現(xiàn)已經(jīng)修復(fù)問題:

$ ldd libqxcb.so

問題解決

再次運(yùn)行qt程序,就可以正常運(yùn)行了。

正常運(yùn)行

后記

又可以愉快的coding了。

總結(jié)

到此這篇關(guān)于Ubuntu18.04下解決Qt出現(xiàn)qt.qpa.plugin:Could not load the Qt platform plugin “xcb“問題的文章就介紹到這了,更多相關(guān)Ubuntu18.04解決Qt出現(xiàn)qt.qpa.plugin內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論