有几个问题需要解决。
首先,我必须修补 Qt,因为在 GCC 11 中,一些标头依赖项已更改,并且 Qt 5.13.2 并不总是包含正确的标头(请参阅https://gcc.gnu.org/gcc-11/porting_to.html https://gcc.gnu.org/gcc-11/porting_to.html or 如何通过编译标志包含头文件? https://stackoverflow.com/questions/67773119/how-can-i-include-header-files-by-compilation-flags).
因此我添加了这一行
#include <limits>
内#ifdef __cplusplus
堵塞
到文件
qt5/qtbase/src/corelib/global/qglobal.h
如果没有使用自己的 FreeType 库,则构建现在会成功。
但是当我添加configure
命令选项
-system-freetype -I /c/Libraries/OpenCascade/3rdPartyMingw64/freetype-2.6.3-mingw-64/include -L/c/Libraries/OpenCascade/3rdPartyMingw64/freetype-2.6.3-mingw-64/bin -L/c/Libraries/OpenCascade/3rdPartyMingw64/freetype-2.6.3-mingw-64/lib
然后运行mingw32-make -j 48
,我收到以下错误消息:
internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:186: MapViewOfFileEx: Attempt to access invalid address.
这可以通过添加选项来解决-no-pch
to the configure
命令。现在的调用如下所示:
../qt5/configure -prefix ../Install -release -recheck-all -confirm-license -no-pch -opensource -platform win32-g++ -opengl desktop -nomake examples -nomake tests -system-freetype -I /c/Libraries/OpenCascade/3rdPartyMingw64/freetype-2.6.3-mingw-64/include -L/c/Libraries/OpenCascade/3rdPartyMingw64/freetype-2.6.3-mingw-64/bin -L/c/Libraries/OpenCascade/3rdPartyMingw64/freetype-2.6.3-mingw-64/lib -skip qtconnectivity -skip qtdeclarative -skip qtlocation -skip qtmultimedia -skip qtquickcontrols -skip qtquickcontrols2 -skip qtsensors -skip qtwebsockets -skip qtwinextras -skip qtwebchannel -skip qtwebengine
运行后configure
构建可以运行
mingw32-make -j 48
它成功了。