qt - 使用 MSYS2/MinGW 64 从源构建 Qt 5.x - 缺少 ICU unicode header

标签 qt sax mingw-w64

成功运行配置脚本后(参见 Building Qt 5.8 from source - configure: Unknown command line option '-c++11')我开始构建:

mingw32-make.exe -j 4

但一段时间后我得到以下错误:

In file included from C:/msys64/home/asp/qt5/qtbase/src/xml/dom/qdom.cpp:55:0:
../../../include/QtXml/5.8.1/QtXml/private/qxml_p.h:1:85: fatal error: ../../../../../../../../../../../home/asp/qt5/qtbase/src/xml/sax/qxml_p.h: No such file or directory
 #include "../../../../../../../../../../../home/asp/qt5/qtbase/src/xml/sax/qxml_p.h"

我搜索了这个文件,它在它应该在的地方:

ls ~/qt5/qtbase/src/xml/sax/
qxml.cpp  qxml.h  qxml_p.h  sax.pri

这是 Qt 5.8.1 的问题还是我忘记设置某些选项?我会尝试 5.7,但我不希望有更好的结果。

对于 5.7,配置脚本不显示成功消息:

Creating qmake...
...........................................................................................Done.
Info: creating stash file C:\msys64\home\asp\qt-build\.qmake.stash
Info: creating super cache file C:\msys64\home\asp\qt-build\.qmake.super

对于 Qt 5.8 有一条消息:

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into 'C:\msys64\opt\qt'

但也许这是正常的,所以我开始构建:

mingw32-make.exe -j 4
cd qtbase/ && ( test -e Makefile || C:/msys64/home/asp/qt-build/qtbase/bin/qmake.exe -o Makefile C:/msys64/home/asp/qt5/qtbase/qtbase.pro ) && C:/msys64/mingw64/bin/mingw32-make -f Makefile
Info: creating cache file C:\msys64\home\asp\qt-build\qtbase\.qmake.cache
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/testcase_targets.prf:4: 'prepareRecursiveTarget' is not a recognized test function.
C:/msys64/home/asp/qt5/qtbase/mkspecs/features/testcase_targets.prf:13: 'prepareRecursiveTarget' is not a recognized test function.
Unknown generator specified: DUMMY
mingw32-make[1]: Entering directory 'C:/msys64/home/asp/qt-build/qtbase'
mingw32-make[1]: Makefile: No such file or directory
mingw32-make[1]: *** No rule to make target 'Makefile'.  Stop.
mingw32-make[1]: Leaving directory 'C:/msys64/home/asp/qt-build/qtbase'
Makefile:75: recipe for target 'module-qtbase-make_first' failed
mingw32-make: *** [module-qtbase-make_first] Error 2

所以 5.7 是别无选择的。

我尝试了来自 Qt Downloads 的其他版本:

  • qt-everywhere-opensource-src-4.8.7.ta​​r.gz
  • qt-everywhere-opensource-src-5.6.0.7z
  • qt-everywhere-opensource-src-5.6.2.7z
  • qt-everywhere-opensource-src-5.7.0.7z
  • qt-everywhere-opensource-src-5.7.1.7z
  • qt-everywhere-opensource-src-5.8.0.7z

所有版本均失败,因为无法找到 unicode 子文件夹中的某些 ICU header 。但是我观察到一件奇怪的事情:如果我在相应的文件夹中手动启动失败的命令,则生成的输出没有错误!然后我可以重新开始制作,稍后再重复这个过程几个文件。但我不能那样做整个构建......

最佳答案

查看我们的存储库,我们是如何构建 Qt5 的: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-qt5

关于qt - 使用 MSYS2/MinGW 64 从源构建 Qt 5.x - 缺少 ICU unicode header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41935631/

相关文章:

android - QML导入错误

c++ - Qt 应用程序不会在特定机器上运行

java - 为什么 DocumentBuilder.parse 抛出 SaxParserException

python - MSYS2 上的破损 pip

c++ - 如何在 Linux 上调用 MinGW 交叉编译器?

c++ - Qt 的 pragma 指令

c++ - 在 Linux 中编译基本 QtWidgets 应用程序时出现 QtCreator 问题

python sax解析器跳过异常

java - 如何在 http 请求正文中发送非法 XML 元素?

c++ - GLEW 链接器错误 undefined reference to '_glew*'