一、下載
Index of /archive/qt/5.12/5.12.8
linux下載.run即可
二、安裝
1.下載完成后在終端打開下載的路徑
?2.賦予執(zhí)行權(quán)限 并執(zhí)行
sudo chmod +x qt-opensource-linux-x64-5.12.8.run
./qt-opensource-linux-x64-5.12.8.run
3..之后的步驟與Windows下安裝一致?
三、命令行安裝(可選)
除了直接下載.run文件安裝外,還可以直接使用apt命令行來安裝Qt,通常使用在開發(fā)版測試環(huán)境中
1.安裝Qt的基本庫與IDE
sudo apt-get install qt5-default
sudo apt-get install qtcreator
2.安裝qmake Cmake
sudo apt-get install qt5-qmake
sudo apt install cmake
3.安裝g++,gcc
sudo apt install g++ gcc
4.安裝QtQucik庫 用來開發(fā)qml頁面
sudo apt-get install qtdeclarative5-dev
5.安裝QMLmodule
sudo apt install qml-module-qtquick-controls2
6.安裝QtMultimedia庫
sudo apt-get install qtmultimedia5-dev
sudo apt-get install libqt5multimedia5-plugins
7.其他開發(fā)庫
sudo apt install qml-module-qtquick-extras
sudo apt install qml-module-qt-labs-platform
8.編譯安裝mqtt
cd /home/linaro/kaifa
git init
git clone git://code.qt.io/qt/qtmqtt.git
git branch -a??
cd qtmqtt/
git checkout origin/5.15.2
qmake
make -j8
等待編譯完成后安裝
make install
9.編譯QtLocation 解決Unknown module(s) in QT: location-private positioning-private
cd /home/linaro/kaifa
git init
git clone git://code.qt.io/qt/qtlocation.git
git branch -a??
cd qtlocation/
git checkout origin/5.15
mkdir build
cd build
sudo apt install qtbase5-private-dev qtdeclarative5-private-dev
qmake ../qtlocation.pro
make -j8
等待編譯完成后安裝
make install
10.位置定位相關(guān)
sudo apt install qtbase5-private-dev
sudo apt install qtlocation5-dev?qtpositioning5-dev
安裝qt例子
apt-get install qtbase5-examples
總結(jié)
1.在qt的pro文件缺少Q(mào)t+=的模塊時 需要源碼編譯或使用命令直接安裝
直接安裝:
Unknown module(s) in QT: webchannel?webengine
sudo apt install qtwebengine5-dev
Unknown module(s) in QT: webview
sudo apt install libqt5webview5-dev
下載源碼編譯:安裝mqtt
2.在qml中import導(dǎo)入的包可以直接使用命令下載
QML module not found(QtQuick.Controls)
apt-get install qml qmlscene
apt-get install qtdeclarative5-dev
apt -y install qml-module-qtquick-controls
apt -y install qml-module-qtquick-controls2
QML module not found(QtQuick.Dialogs)
apt install qml-module-qtquick-dialogs
module "QtQuick.Shapes" is not installed
apt install qml-module-qtquick-shapes
"Qt.labs.folderlistmodel" is not installed
apt install qml-module-qt-labs-folderlistmodel
"Qt.labs.settings" is not installed
apt install qml-module-qt-labs-settings
“QtWebChannel” is not installed
sudo apt install qml-module-qtwebengine
sudo apt install qml-module-qtwebview文章來源:http://www.zghlxwxcb.cn/news/detail-402866.html
sudo apt install qml-module-qtwebchannel文章來源地址http://www.zghlxwxcb.cn/news/detail-402866.html
如果在運行某些程序報錯原因是缺少某些庫
可用sudo apt install lib*?或者qml*來模糊匹配可能需要的庫(根據(jù)遇到的錯誤報告來安裝)
到了這里,關(guān)于Linux(Ubuntu20)下安裝Qt5.12.8 包含直接命令行安裝(2)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!