ubuntu 静态编译Qt 15.3
下载源代码:
wget https://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/5.15/5.15.3/single/qt-everywhere-opensource-src-5.15.3.tar.xz
解压缩:
tar xvf qt-everywhere-opensource-src-5.15.3.tar.xz -C ~/opt
cd ~/opt/qt-everywhere-opensource-src-5.15.3
./configure -prefix ~/opt/qt5.15.3-x64 -release -opensource -confirm-license -static -shared -platform linux-g++ -qt-freetype -no-pch -no-avx -no-openssl -no-cups -no-dbus -no-opengl -no-glib -no-xcb -no-eglfs -no-pkg-config -no-iconv -skip qtwebchannel -skip qtcanvas3d
可能会出现错误
/qt-everywhere-src-5.15.3/qtbase/src/corelib/text/qbytearraymatcher.h:105:38:error: ‘numeric_limits’ is not a member of ‘std’
105 | const auto uchar_max = (std::numeric_limits<uchar>::max)();
修改~/opt/qt-everywhere-src-5.15.3/qtbase/src/corelib/text/qbytearray.h
添加
#include <limits>
再次运行configure
make
出现错误:
gcc: error: unrecognized command line option ‘-mshstk’; did you mean ‘-msha’?
本文链接地址:https://const.net.cn/757.html