Visual studio 2017 使用Visual Studio 2017项目构建,但MSC版本显示为1900

Visual studio 2017 使用Visual Studio 2017项目构建,但MSC版本显示为1900,visual-studio-2017,static-libraries,solution,vcxproj,Visual Studio 2017,Static Libraries,Solution,Vcxproj,我有一个项目的问题,也许有人可以给我一些提示。我在解决方案中有一个项目,它是上次使用Visual Studio 2015创建或更新的。现在,我想用Visual Studio 2017构建这个项目 因此,我使用参数启动批处理文件%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat amd64。然后,我使用命令devenv solution.sln/upgrade升级项

我有一个项目的问题,也许有人可以给我一些提示。我在解决方案中有一个项目,它是上次使用Visual Studio 2015创建或更新的。现在,我想用Visual Studio 2017构建这个项目

因此,我使用参数启动批处理文件
%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat amd64
。然后,我使用命令
devenv solution.sln/upgrade
升级项目。我看到以下输出:

Microsoft Visual Studio 2017 Version 15.0.27703.1.
Copyright (C) Microsoft Corp. All rights reserved.
Upgrading project 'project1'...
    Configuration 'Debug|Win32': changing Platform Toolset to 'v141' (was 'v140').
    Configuration 'Debug|x64': changing Platform Toolset to 'v141' (was 'v140').
    Configuration 'Release|Win32': changing Platform Toolset to 'v141' (was 'v140').
    Configuration 'Release|x64': changing Platform Toolset to 'v141' (was 'v140').

Migration completed successfully, but some warnings were detected during migration.
For more information, see the migration report:
C:\path\to\project\UpgradeLog.htm
在此
UpgradeLog.htm
中,我只看到以下警告:

solution.sln: Visual Studio needs to make non-functional changes to this project in order to enable the project to open in released versions of Visual Studio newer than Visual Studio 2010 SP1 without impacting project behavior.
然后,在构建项目时,我会在构建项目时看到此消息(我在此处删除了真实的项目名称、源文件名称和真实路径。这应该不是问题):

但是后来,当我在文件
project.lib
中使用命令
find“\u MSC\u VER”project.lib
搜索
\u MSC\u VER
时,我得到了以下输出(多次):

但是我希望得到这个输出(因为使用
VisualStudio2017
构建):

如何做到这一点?

/failifmissmatch:“\u MSC\u VER=1900”
表示该文件是通过以下方式生成的。因为,根据升级日志,
project1
已经迁移到v141,我认为:

  • 它尚未重建,您正在链接到旧的.obj文件;或
  • 您看到的消息来自其他用户构建的对象文件 针对v140的项目

关于编译时消息,我怀疑您使用的Boost库不晚于1.62—您可以在页面底部看到版本检查和消息。如果是这种情况,您将需要更新Boost库或将平台工具集更改回v140。

存在/FailifMitch注入链接器选项,以验证您没有尝试链接任何使用不兼容编译器版本构建的库。关注不兼容,VS2015和VS2017都使用140版运行时DLL。这与您需要编辑c3.cpp的原因无关
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\CL.exe /c /Iinclude /IC:\path\to\other\include /Zi /nologo /W3 /WX- /diagnostics:classic /MP /O2 /Ob2 /Ot /Oy- /GL /D WIN64 /D NDEBUG /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Release\x64\\" /Fd"C:\path\to\debug\symbols\debug.pdb" /Gd /TP /FC /errorReport:queue c1.cpp c2.cpp c3.cpp
  c1.cpp
  c2.cpp
  c3.cpp
  Unknown compiler version - please run the configure tests and report the results
  Unknown compiler version - please run the configure tests and report the results
  Unknown compiler version - please run the configure tests and report the results
Lib:
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\Lib.exe /OUT:"C:\path\to\lib\project.lib" some_other.lib /LIBPATH:C:\path\to\other\lib64 /NOLOGO /MACHINE:X64 /LTCG Release\x64\c1.obj
  Release\x64\c2.obj
  Release\x64\c3.obj
/FAILIFMISMATCH:"_MSC_VER=1900"
/FAILIFMISMATCH:"_MSC_VER=1910"