当前位置:   article > 正文

Linux(Ubuntu20)下安装Qt5.12.8 包含直接命令行安装(2)_linuxqt下载

linuxqt下载

一、下载

Index of /archive/qt/5.12/5.12.8

linux下载.run即可

二、安装

1.下载完成后在终端打开下载的路径

 2.赋予执行权限 并执行

sudo chmod +x qt-opensource-linux-x64-5.12.8.run

./qt-opensource-linux-x64-5.12.8.run

3..之后的步骤与Windows下安装一致 

三、命令行安装(可选)

除了直接下载.run文件安装外,还可以直接使用apt命令行来安装Qt,通常使用在开发版测试环境中

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库 用来开发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.其他开发库

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.位置定位相关

sudo apt install qtbase5-private-dev

sudo apt install qtlocation5-dev qtpositioning5-dev

安装qt例子

apt-get install qtbase5-examples

总结

1.在qt的pro文件缺少Qt+=的模块时 需要源码编译或使用命令直接安装

直接安装:

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导入的包可以直接使用命令下载

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

sudo apt install qml-module-qtwebchannel

如果在运行某些程序报错原因是缺少某些库

可用sudo apt install lib* 或者qml*来模糊匹配可能需要的库(根据遇到的错误报告来安装)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/138479
推荐阅读
相关标签
  

闽ICP备14008679号