install-qt5-from-sources-centos7

2023-10-14 22:16:39  阅读 134 次 评论 0 条

# - Make sure you have a recent GCC compiler supporting, at least, C++11

# install dependencies
sudo yum install libxcb libxcb-devel xcb-util xcb-util-devel libxkbcommon-devel libxkbcommon-x11-devel
sudo yum install xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel
# install MESA libs if you don't have NVidia drivers installed
#sudo yum install mesa-libGL-devel

# get the code and extract
wget http://download.qt.io/official_releases/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
# out-of-source build
mkdir buildqt5
cd buildqt5
../qt-everywhere-src-5.15.0/configure -opensource -confirm-license -xcb -xcb-xlib -bundled-xcb-xinput
make -j
# Install Qt5. By default, it will be installed under `/usr/local/Qt-5.15.0`.
# (Reconfigure the build with ./configure -prefix=<path> if you want to install it into another folder)
sudo make install

# Now, in order to use the newly installed Qt5, you have to instruct the environemnt to use it.
export PATH=/usr/local/Qt-5.15.0/bin:$PATH  # for bash shell

# Test
qmake --version
# You should see:
#    QMake version 3.1
#    Using Qt version 5.15.0 in /usr/local/Qt-5.15.0/lib

# Notes:
# - if you want to rebuild Qt5, make sure you clean the build folder first (or create a new build folder);
# otherwise, the build is misconfigured and you get compilation errors or missing files in the installation
# (a missing `qmake` from the `/usr/local/Qt-5.15.0/bin` installation folder is a symptom of that...)

@chinamore

 


本文地址:https://175.es/blog/post/660.html
免责声明:本文为原创文章,版权归 人潮中惊鸿一瞥 所有,欢迎分享本文,转载请保留出处!

发表评论


表情

还没有留言,还不快点抢沙发?