【发布时间】:2021-09-05 22:12:41
【问题描述】:
长期以来,我一直在使用 GCC/MinGW-w64 在 Windows 上成功构建 Qt 5。当我尝试使用 GCC 11.1 时,构建失败并出现奇怪的错误消息。我该怎么做才能让它发挥作用?
我自己使用https://github.com/niXman/mingw-builds 的develop 分支通过以下命令构建了编译器:
../build --mode=gcc-11.1.0 --arch=x86_64 --buildroot=/c/mingw-builds/BuildRoot --update-sources --exceptions=seh --threads=posix --enable-languages=c++ --jobs=48 --rt-version=v7
然后我在 MSYS2 控制台上像这样检索 Qt:
# Ensure that the right Perl is being used to prevent the possible later compilation error "fatal error: QVector: No such file or directory"
export PATH=/c/Strawberry/perl/bin/:$PATH
cd /c
cd Libraries/
mkdir Qt
cd Qt
git clone git://code.qt.io/qt/qt5.git
cd qt5
git checkout v5.13.2
perl init-repository --module-subset=essential --berlin
cd ..
然后我尝试构建 Qt:
mkdir Build
cd Build
../qt5/configure -prefix ../Install -release -recheck-all -confirm-license -opensource -platform win32-g++ -opengl desktop -nomake examples -nomake tests -skip qtconnectivity -skip qtdeclarative -skip qtlocation -skip qtmultimedia -skip qtquickcontrols -skip qtquickcontrols2 -skip qtsensors -skip qtwebsockets -skip qtwinextras -skip qtwebchannel -skip qtwebengine
mingw32-make -j 48
但是configure 显示很多类似这样的错误:
qt5/qtbase/src/corelib/global/qendian.h:333:35: error: 'numeric_limits' is not a member of 'std'
我该如何解决?
此外,我想将它与“Open CASCADE”分发的“FreeType”库(为 MinGW 构建的版本)链接起来(参见https://dev.opencascade.org/resources/download/3rd-party-components)。这怎么可能?
【问题讨论】: