CentOS 安装 Qt 5.12.3

1. 安装依赖包

yum groupinstall -y "Development Tools"
yum install -y libGL libGL-devel
yum install -y mesa-libGL-devel mesa-libGLU-devel freeglut-devel
yum install -y libxcb libxcb-devel libXrender libXrender-devel xcb-util-wm xcb-util-wm-devel xcb-util xcb-util-devel xcb-util-image xcb-util-image-devel xcb-util-keysyms xcb-util-keysyms-devel

2. 从 http://download.qt.io/archive/qt/ 下载 qt-opensource-linux-x64-5.12.3.run

3. 上传到 CentOS 的 /opt 上,进行安装

cd /opt
chmod 755 qt-opensource-linux-x64-5.12.3.run
./qt-opensource-linux-x64-5.12.3.run

4. 添加环境变量

vi ~/.bash_profile


======== AS ======== 
export QTDIR=/opt/Qt5.12.3
export PATH=$QTDIR/5.12.3/gcc_64/bin:$PATH
export MANPATH=$QTDIR/man:$MANPAT
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
======== AE ======== 

source ~/.bash_profile

 任意目录下测试环境变量是否可用

qmake -v

能显示版本就是对的

你可能感兴趣的:(linux,使用,qt)