跳转至

从源代码安装 Qt

0.简介通过本地编译从 opensouce 安装 Qt。

Qt-5.15.2为例。

1.下载从官方网站或镜像(例如UTSC)下载 Qt-5.15.2 。```

wget http://mirrors.ustc.edu.cn/qtproject/official_releases/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz

## 2.安装依赖并解压```
sudo apt install libX11-dev libXext-dev libXtst-dev -y 
tar -xvf qt-everywhere-src-5.15.2.tar.xz

3.目录并配置```

cd qt-everywhere-src-5.15.2 ./configure -prefix /usr/local/qt-5.15.2 -opensource -developer-build \ -confirm-license -nomake tests -nomake examples

## 4.制作并安装```
make -j8
sudo make install

由于上面的配置,Qt 将安装到/usr/local/qt-5.15.2

5.Qt安装脚本

参考文献[1]. https://qt.io

[2]. http://mirrors.ustc.edu.cn/help/qtproject.html