为Visual Studio Community 2015构建Qt 5.6.0时出错

为Visual Studio Community 2015构建Qt 5.6.0时出错,qt,compiler-errors,visual-studio-2015,nmake,Qt,Compiler Errors,Visual Studio 2015,Nmake,我一直在尝试构建用于Visual Studio 2015社区的Qt 5.6.0,但他们网站和Qt wiki上的文档在为Visual Studio构建它时并不十分具体。我也尝试过其他教程来构建它,但没有成功 我尝试过以下教程: 以下是我在尝试构建它时采取的步骤: 将源代码从git repo克隆到D:\Programs\qt5 检查了我想要的分支。在本例中为5.6.0。 仅克隆essentials模块子集以缩短生成时间。 创建了一个批处理脚本,用于设置cmd会话的环境变量,并将其放置在D:\Pr

我一直在尝试构建用于Visual Studio 2015社区的Qt 5.6.0,但他们网站和Qt wiki上的文档在为Visual Studio构建它时并不十分具体。我也尝试过其他教程来构建它,但没有成功

我尝试过以下教程:

以下是我在尝试构建它时采取的步骤:

  • 将源代码从git repo克隆到D:\Programs\qt5

  • 检查了我想要的分支。在本例中为5.6.0。

  • 仅克隆essentials模块子集以缩短生成时间。

  • 创建了一个批处理脚本,用于设置cmd会话的环境变量,并将其放置在D:\Programs\qt5:

    REM Set up \Microsoft Visual Studio 2015, where <arch> is \c amd64, \c x86, etc.
    CALL "D:\Programs\Visual Studio 2015 Community\VC\vcvarsall.bat" amd64
    SET _ROOT=D:\Programs\qt5
    SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
    REM Uncomment the below line when using a git checkout of the source repository
    SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
    SET QMAKESPEC=win32-msvc2015
    SET _ROOT=
    REM When compiling with ICU, uncomment the lines below and change <icupath> appropriately:
    REM SET INCLUDE=<icupath>\include;%INCLUDE%
    REM SET LIB=<icupath>\lib;%LIB%
    REM SET PATH=<icupath>\lib;%PATH% 
    
    *是否有办法使用configure命令仅构建essentials模块子集?

  • 输入用于构建Qt的命令。

    nmake
    
    当我尝试构建它时,会出现以下错误:

  • D:\Programs\qt5>nmake Microsoft(R)程序维护实用程序版本14.00.23506.0 版权所有(C)微软公司。版权所有。 cd qtbase\&(如果不存在Makefile D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\qtbase.pro-o Makefile)&&nmake-f Makefile Microsoft(R)程序维护实用程序版本14.00.23506.0 版权所有(C)微软公司。版权所有。 cd src\&(如果不存在Makefile D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\src\src.pro-o Makefile)&&nmake-f Makefile Microsoft(R)程序维护实用程序版本14.00.23506.0 版权所有(C)微软公司。版权所有。 cd corelib\&(如果不存在Makefile.qtzlib D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\src\corelib\qtzlib.pro-o Makefile.qtzlib)&&nmake-f Makefile.qtzlib Microsoft(R)程序维护实用程序版本14.00.23506.0 版权所有(C)微软公司。版权所有。 nmake-f Makefile.qtzlib.Debug all Microsoft(R)程序维护实用程序版本14.00.23506.0 版权所有(C)微软公司。版权所有。 复制/y..\lib\Qt5Zlibd.dll..\bin 系统找不到指定的文件。 nmake-f Makefile.qtzlib.Release all Microsoft(R)程序维护实用程序版本14.00.23506.0 版权所有(C)微软公司。版权所有。 复制/y..\lib\Qt5Zlib.dll..\bin 系统找不到指定的文件。 cd tools\bootstrap\&(如果不存在Makefile D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\src\tools\bootstrap\bootstrap.pro-o Makefile)&&nmake-f Makefile Microsoft(R)程序维护实用程序版本14.00.23506.0 版权所有(C)微软公司。版权所有。 nmake-f Makefile.Debug Microsoft(R)程序维护实用程序版本14.00.23506.0 版权所有(C)微软公司。版权所有。 cl-c-nologo-Zc:wchar_t-FS-Zi-MDd-D_有异常=0-MP-GR-W3-w34100-w34189-w44996-WX/Fd…...\lib\Qt5Bootstrapd.pdb-DUNICODE-DWIN32-DWIN64-DQT-BOOTSTRAPPED-DQT-DQT-LITE-UNICODE-DQT-DQT-NO-CAST-TO-DQT-DQT-nou-DQT-ASCII-DQT-DQT-nou-CODECS-DQT-DQT-DQT-nou-DQT-DQT-qt-qt-qt-nou-ASCII-du-du-qt-du-qt-qt-qt-qt-qt-qt-u-DQT_NO_USING_NAMESPACE-DQT_NO_DEPRECATED-DQT_NO_TRANSLATION-DQT_cryptographics hash_ONLY_SHA1-DQT_NO_CAST_FROM_ASCII-DQT_builder_BOOTSTRAP_LIB-DQT_BUILDING__-CRT-D_-SECURE_-NO_警告-D_使用数学定义-DQT_ASCII_CAST警告-DQT_MOC_COMPAT_-DQT_禁用兼容-DQT_使用_Tringbuilder-DEPRECATED_警告-0x800之前-DQT\u无例外-I.-I..\3rdparty\zlib-I..\include-I..\include\QtCore-I..\include\QtCore\5.6.1-I..\include\QtCore\5.6.1\QtCore-I..\include\QtXml-I..\include\QtXml\5.6.1-I..\include\QtXml\5.6.1\QtXml-Itmp-I..\f2013-MSJ调试规范@C:\Users\Justin\AppData\Local\Temp\nm3B49.tmp qlatincodec.cpp qtextcodec.cpp qutfcodec.cpp d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52):错误C2220:警告被视为错误-未生成“对象”文件(编译源文件….\\corelib\codecs\qlatincodec.cpp) d:\programs\qt5\qtbase\include\qtcore\..//src/corelib/global/qflags.h(52):警告C4577:未指定异常处理模式时使用“noexcept”;不保证在例外情况下终止。指定/EHsc(编译源文件..\..\corelib\codecs\qlatincodec.cpp) D:\Qt5\qtBase\\qtCys\//sRC/CORILB/Global /QFLAG.H(52):注意:为了简化迁移,考虑使用临时编译的/Wv:18标志,使用编译的版本,没有警告(编译源文件…\CORILB\CODES\QLATIN CODEC .CPP)。 d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52):错误C2220:警告被视为错误-未生成“对象”文件(编译源文件…\corelib\codecs\qutfcodec.cpp) d:\programs\qt5\qtbase\include\qtcore\..//src/corelib/global/qflags.h(52):警告C4577:未指定异常处理模式时使用“noexcept”;不保证在例外情况下终止。指定/EHsc(编译源文件..\..\corelib\codecs\qutfcodec.cpp) D:\Qt5\qtBase\\qtCyc\//sRC/CORILB/Global /QFLAG.H(52):注意:为了简化迁移,考虑使用临时编译的/Wv:18标志,使用编译的版本,没有警告(编译源文件…\CORILB\CODECS\QTFCODEC.CPP)。 d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52):错误C2220:警告被视为错误-未生成“对象”文件(编译源文件….\\corelib\codecs\qtextcodec.cpp) d:\programs\qt5\qtbase\inc
    nmake
    
    D:\Programs\qt5>nmake Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 Copyright (C) Microsoft Corporation. All rights reserved. cd qtbase\ && ( if not exist Makefile D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\qtbase.pro -o Makefile ) && nmake -f Makefile Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 Copyright (C) Microsoft Corporation. All rights reserved. cd src\ && ( if not exist Makefile D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\src\src.pro -o Makefile ) && nmake -f Makefile Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 Copyright (C) Microsoft Corporation. All rights reserved. cd corelib\ && ( if not exist Makefile.qtzlib D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\src\corelib\qtzlib.pro -o Makefile.qtzlib ) && nmake -f Makefile.qtzlib Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 Copyright (C) Microsoft Corporation. All rights reserved. nmake -f Makefile.qtzlib.Debug all Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 Copyright (C) Microsoft Corporation. All rights reserved. copy /y ..\..\lib\Qt5Zlibd.dll ..\..\bin The system cannot find the file specified. nmake -f Makefile.qtzlib.Release all Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 Copyright (C) Microsoft Corporation. All rights reserved. copy /y ..\..\lib\Qt5Zlib.dll ..\..\bin The system cannot find the file specified. cd tools\bootstrap\ && ( if not exist Makefile D:\Programs\qt5\qtbase\bin\qmake D:\Programs\qt5\qtbase\src\tools\bootstrap\bootstrap.pro -o Makefile ) && nmake -f Makefile Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 Copyright (C) Microsoft Corporation. All rights reserved. nmake -f Makefile.Debug Microsoft (R) Program Maintenance Utility Version 14.00.23506.0 Copyright (C) Microsoft Corporation. All rights reserved. cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -D_HAS_EXCEPTIONS=0 -MP -GR -W3 -w34100 -w34189 -w44996 -WX /Fd..\..\..\lib\Qt5Bootstrapd.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_NO_CAST_FROM_ASCII -DQT_BUILD_BOOTSTRAP_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_EXCEPTIONS -I. -I..\..\3rdparty\zlib -I..\..\..\include -I..\..\..\include\QtCore -I..\..\..\include\QtCore\5.6.1 -I..\..\..\include\QtCore\5.6.1\QtCore -I..\..\..\include\QtXml -I..\..\..\include\QtXml\5.6.1 -I..\..\..\include\QtXml\5.6.1\QtXml -Itmp -I..\..\..\mkspecs\win32-msvc2013 -Fo.obj\debug\ @C:\Users\Justin\AppData\Local\Temp\nm3B49.tmp qlatincodec.cpp qtextcodec.cpp qutfcodec.cpp d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): error C2220: warning treated as error - no 'object' file generated (compiling source file ..\..\corelib\codecs\qlatincodec.cpp) d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc (compiling source file ..\..\corelib\codecs\qlatincodec.cpp) d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings (compiling source file ..\..\corelib\codecs\qlatincodec.cpp) d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): error C2220: warning treated as error - no 'object' file generated (compiling source file ..\..\corelib\codecs\qutfcodec.cpp) d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc (compiling source file ..\..\corelib\codecs\qutfcodec.cpp) d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings (compiling source file ..\..\corelib\codecs\qutfcodec.cpp) d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): error C2220: warning treated as error - no 'object' file generated (compiling source file ..\..\corelib\codecs\qtextcodec.cpp) d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc (compiling source file ..\..\corelib\codecs\qtextcodec.cpp) d:\programs\qt5\qtbase\include\qtcore\../../src/corelib/global/qflags.h(52): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings (compiling source file ..\..\corelib\codecs\qtextcodec.cpp) NMAKE : fatal error U1077: '"D:\Programs\Visual Studio 2015 Community\VC\BIN\amd64\cl.EXE"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"D:\Programs\Visual Studio 2015 Community\VC\BIN\amd64\nmake.EXE"' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.