centos7源码安装qt
时间: 2023-10-26 18:06:58 浏览: 191
安装 Qt 的步骤如下:
1. 下载 Qt 源码包并解压缩。
2. 安装必要的依赖库,如:gcc、make、g++、libGL、libGLU、libSM、libICE、libXrender、libfontconfig、libXext、libX11、alsa-lib 等。
3. 配置 Qt 编译选项,如设置安装路径、编译模块等。
4. 编译并安装 Qt。
具体操作步骤可参考以下命令:
```
# 安装必要的依赖库
sudo yum install gcc make g++ libGL libGLU libSM libICE libXrender libfontconfig libXext libX11 alsa-lib
# 下载 Qt 源码包并解压缩
wget https://download.qt.io/archive/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz
tar -xvf qt-everywhere-src-5.15.0.tar.xz
# 进入解压后的目录,配置 Qt 编译选项
cd qt-everywhere-src-5.15.0
./configure -prefix /usr/local/qt5 \
-opensource \
-confirm-license \
-nomake examples \
-no-pch \
-no-dbus \
-no-opengl \
-no-xcb \
-no-cups \
-no-iconv \
-no-glib \
-no-gstreamer \
-no-feature-relocatable \
QMAKE_LFLAGS+="-latomic"
# 编译 Qt
make -j4
# 安装 Qt
sudo make install
```
阅读全文
相关推荐

















