0

我的项目有问题,也许有人可以给我一些提示。我在解决方案中有一个项目,该项目是上次使用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.

然后,在构建项目时,我在构建项目时看到此消息(我在这里删除了真实的项目名称,源文件的名称和真实的路径。这应该没有问题):

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

但后来,当我使用命令在文件project.lib中搜索时,我得到了这个输出(几次):_MSC_VERfind "_MSC_VER" project.lib

/FAILIFMISMATCH:"_MSC_VER=1900"

但我希望得到这个输出(因为用 构建Visual Studio 2017):

/FAILIFMISMATCH:"_MSC_VER=1910"

这怎么可能?

4

1 回答 1

1

/FAILIFMISMATCH:"_MSC_VER=1900"表示该文件是使用MSVC++ 14.0 (Platform Toolset v140) 构建的。因为,根据升级日志,project1已经迁移到 v141,我认为要么:

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

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

于 2018-05-17T15:15:03.480 回答