濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > Ubuntu18.04下解決Qt出現(xiàn)qt.qpa.plugin:Could not load the Qt platform plugin “xcb“問(wèn)題

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

熱門(mén)標(biāo)簽:電話機(jī)器人服務(wù)差 智能外呼系統(tǒng)如何部署 電銷機(jī)器人對(duì)公司貢獻(xiàn) 宿州防封外呼系統(tǒng)廠家 濟(jì)源電話外呼系統(tǒng)怎么樣 高德地圖標(biāo)注在建線路 蘭州語(yǔ)音電銷機(jī)器人軟件 ai電銷機(jī)器人 如何開(kāi)發(fā) 山東400電話如何辦理

問(wèn)題描述

安裝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ù)問(wèn)題描述,雖然能夠找到但是不能加載Qt平臺(tái)插件“xcb”,雖然接下來(lái)又說(shuō)重新安裝可能能夠解決,這個(gè)可能的話,還是盡量作為最下的選擇吧。

定位問(wèn)題

修改配置文件~/.bashrc:

$ vim ~/.bashrc

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

export QT_DEBUG_PLUGINS=1

如下:

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

$ source ~/.bashrc

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

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

也就是Qt動(dòng)態(tài)鏈接庫(kù)的問(wèn)題,當(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

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

解決方法

安裝libxcb-xinerama庫(kù):

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

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

$ ldd libqxcb.so

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

后記

又可以愉快的coding了。

總結(jié)

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

標(biāo)簽:云南 晉中 衡水 安陽(yáng) 畢節(jié) 南寧 巴中 佛山

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Ubuntu18.04下解決Qt出現(xiàn)qt.qpa.plugin:Could not load the Qt platform plugin “xcb“問(wèn)題》,本文關(guān)鍵詞  Ubuntu18.04,下,解決,出現(xiàn),;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Ubuntu18.04下解決Qt出現(xiàn)qt.qpa.plugin:Could not load the Qt platform plugin “xcb“問(wèn)題》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于Ubuntu18.04下解決Qt出現(xiàn)qt.qpa.plugin:Could not load the Qt platform plugin “xcb“問(wèn)題的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    镇原县| 延寿县| 临安市| 聊城市| 宜宾县| 开封市| 贵南县| 民县| 栾川县| 曲阳县| 额济纳旗| 大田县| 四川省| 广灵县| 昌平区| 龙南县| 乐山市| 灌云县| 封开县| 昂仁县| 安西县| 东明县| 临朐县| 图木舒克市| 海宁市| 南皮县| 全州县| 都安| 界首市| 曲沃县| 广元市| 平顺县| 陆丰市| 新绛县| 建水县| 松原市| 吉隆县| 哈巴河县| 彭山县| 崇文区| 蓬安县|