1、更新QT依賴
在深度系統的終端中運行以下命令:
sudo apt-get install build-essential
sudo apt-get install libgl1-mesa-dev
sudo apt-get install gdb
2、下載QT6安裝包
地址在:https://download.qt.io/archive/qt/
eg.qt-unified-linux-x64-4.2.0-online.run
3、下載libxcb-util安裝包
下載地址:http://ftp.br.debian.org/debian/pool/main/x/xcb-util/libxcb-util1_0.4.0-1+b1_amd64.deb
注:如果是其它平台,請到http://ftp.br.debian.org/debian/pool/main/x/xcb-util/下載相應的軟件包。
下載后使用sudo dpkg -i libxcb-util1_0.4.0-1+b1_amd64.deb命令安裝
下載該包可以解決如下錯誤
./qtcreator 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.
大意為:
qt.qpa.plugin:即使找到Qt平台插件“xcb”,也無法將其加載到"qt"中。此應用程序無法啟動,因為無法初始化Qt平台插件,重新安裝該應用程序可能會解決此問題。
可用的平台插件為:eglfs,linuxfb,minimum,minimegl,offscreen,vnc,xcb。
4、運行以下命令安裝QT
運行形如以下命令:
sudo ./your/download/path/*.run文件
說明:請根據自己的情況進行調整,加上sudo默認安裝到/opt,否則默認安裝到/home目錄下。