Error building Qt for Visual Studio: “ninja: build stopped: subcommand failed.”

I am building Qt 5.9.1 using Visual Studio 2017 and Windows 10. I used x64 Native Tools Command Prompt for VS 2017 and this configuration

configure -mp -opensource -prefix E:\Library\qt.9.1\msvc_x64 -debug-and-release -nomake tests -nomake examples -qt-zlib -qt-libpng -qt-libjpeg

and ran nmake, but I got this error:

[8496/18067] CXX obj/cc/base/base/histograms.ob
注意: 包含文件:  E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\cc/base/histograms.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/compiler_specific.h
注意: 包含文件:    E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\build/build_config.h
注意: 包含文件:    C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\sal.h
注意: 包含文件:     C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\ConcurrencySal.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/macros.h
注意: 包含文件:    C:\Program Files (x86)\Windows Kits\include.0.15063.0\ucrt\stddef.h
注意: 包含文件:     C:\Program Files (x86)\Windows Kits\include.0.15063.0\ucrt\corecrt.h
注意: 包含文件:      C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vcruntime.h
注意: 包含文件:       C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vadefs.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram_base.h
注意: 包含文件:    C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\limits.h
注意: 包含文件:     C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vcruntime.h
注意: 包含文件:    C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\stdint.h
....

a lot of includes

....
注意: 包含文件:     E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram_macros.h
注意: 包含文件:     E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram_samples.h
注意: 包含文件:    E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram_macros_internal.h
注意: 包含文件:     E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/sparse_histogram.h
注意: 包含文件:      E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/synchronization/lock.h
注意: 包含文件:       E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/synchronization/lock_impl.h
注意: 包含文件:       E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/threading/platform_thread.h
注意: 包含文件:    E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram_macros_local.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/strings/stringprintf.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/timer/elapsed_timer.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\cc/base/cc_export.h
注意: 包含文件:  C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\algorithm
注意: 包含文件:  E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/lazy_instance.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/debug/leak_annotations.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/memory/aligned_memory.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/threading/thread_restrictions.h
ninja: build stopped: subcommand failed.
NMAKE : fatal error U1077: “call”: 返回代码“0x1”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\bin\HostX64\x64\nmake.exe"”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “(”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “cd”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “cd”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “cd”: 返回代码“0x2”
Stop.

I’ve no idea what happened and how to solve this.

Update:
I tried Jom, and it gives similar result, but at different position:

[6/9573] CXX obj/cc/base/base/invalidation_region.obj
注意: 包含文件:  E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\cc/base/invalidation_region.h
注意: 包含文件:   C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vector
注意: 包含文件:    C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\xmemory
注意: 包含文件:     C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\xmemory0
注意: 包含文件:      C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\cstdint
注意: 包含文件:       C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\yvals.h
注意: 包含文件:        C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\xkeycheck.h
注意: 包含文件:        C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\crtdefs.h
注意: 包含文件:         C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vcruntime.h
注意: 包含文件:          C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\sal.h
注意: 包含文件:           C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\ConcurrencySal.h
注意: 包含文件:          C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vadefs.h
注意: 包含文件:         C:\Program Files (x86)\Windows Kits\include.0.15063.0\ucrt\corecrt.h
注意: 包含文件:          C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vcruntime.h
注意: 包含文件:        C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\use_ansi.h
注意: 包含文件:       C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\stdint.h
注意: 包含文件:        C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vcruntime.h
注意: 包含文件:      C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\cstdlib
...

...
注意: 包含文件:         C:\Program Files (x86)\Windows Kits\include.0.15063.0\um\ime_cmodes.h
注意: 包含文件:       C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\intrin.h
注意: 包含文件:        C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vcruntime.h
注意: 包含文件:        C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\setjmp.h
注意: 包含文件:         C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\vcruntime.h
注意: 包含文件:        C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\immintrin.h
注意: 包含文件:         C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\wmmintrin.h
注意: 包含文件:          C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\nmmintrin.h
注意: 包含文件:           C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\smmintrin.h
注意: 包含文件:            C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\tmmintrin.h
注意: 包含文件:             C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\pmmintrin.h
注意: 包含文件:              C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\emmintrin.h
注意: 包含文件:         C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\zmmintrin.h
注意: 包含文件:        C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Tools\MSVC.10.25017\include\ammintrin.h
注意: 包含文件:     E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/strings/string_piece.h
注意: 包含文件:      E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/strings/string16.h
注意: 包含文件:     E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/time/time.h
注意: 包含文件:      C:\Program Files (x86)\Windows Kits\include.0.15063.0\ucrt\time.h
注意: 包含文件:   E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram_macros.h
注意: 包含文件:    E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram.h
注意: 包含文件:    E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram_macros_internal.h
注意: 包含文件:     E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/sparse_histogram.h
注意: 包含文件:      E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram_samples.h
注意: 包含文件:      E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/synchronization/lock.h
注意: 包含文件:       E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/synchronization/lock_impl.h
注意: 包含文件:       E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/threading/platform_thread.h
注意: 包含文件:    E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\srcrdparty\chromium\base/metrics/histogram_macros_local.h
ninja: build stopped: subcommand failed.
jom: E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\src\core\Makefile.gn_run.Debug [run_ninja] Error 1
jom: E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\src\core\Makefile.gn_run [debug-all] Error 2
jom: E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\src\core\Makefile [sub-gn_run-pro-make_first] Error 2
jom: E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\src\Makefile [sub-core-make_first] Error 2
jom: E:\Library\qt-everywhere-opensource-src-5.9.1\qtwebengine\Makefile [sub-src-make_first] Error 2
jom: E:\Library\qt-everywhere-opensource-src-5.9.1\Makefile [module-qtwebengine-make_first] Error 2 

Read more here: Source link