成功运行配置脚本(参见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时,configure脚本不会显示成功消息:
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的其他版本:
所有版本都失败,因为无法找到unicode子文件夹中的某些ICU标头。但我发现了一件奇怪的事情:如果我在相应的文件夹中手动启动失败的命令,则生成的输出没有错误!然后我可以再次开始制作并再次重复此过程几个文件。但我无法以这种方式完成整个构建......
答案 0 :(得分:1)
查看我们的存储库如何构建Qt5: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-qt5