VS2017 + ICC 19.0:运行MSBuild命令失败

问题描述 投票:0回答:1

我正在尝试在ICC 19.0编译器之上使用Visual Studio 2017构建C ++项目。

这是我尝试执行的命令:

cmake -G "Visual Studio 15 2017 Win64" -T "Intel C++ Compiler 19.0" ..

这是我总是得到的错误:

CMake Error at CMakeLists.txt:17 (project):
  Failed to run MSBuild command:

    C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/Bin/MSBuild.exe

  to get the value of VCTargetsPath:

    Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.

    Build started 2019-12-24 15:19:24.
    Project "C:\Users\user001\Desktop\myproject\build\CMakeFiles\3.16.2\VCTargetsPath.vcxproj" on node 1 (default targets).
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Redirect.14.props(47,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.cpp.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [C:\Users\user001\Desktop\myproject\build\CMakeFiles\3.16.2\VCTargetsPath.vcxproj]
    Done Building Project "C:\Users\user001\Desktop\myproject\build\CMakeFiles\3.16.2\VCTargetsPath.vcxproj" (default targets) -- FAILED.

    Build FAILED.

    "C:\Users\user001\Desktop\myproject\build\CMakeFiles\3.16.2\VCTargetsPath.vcxproj" (default target) (1) ->
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Redirect.14.props(47,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.cpp.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [C:\Users\user001\Desktop\myproject\build\CMakeFiles\3.16.2\VCTargetsPath.vcxproj]

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:00.08


  Exit code: 1



-- Configuring incomplete, errors occurred!

为此,我确实安装了VS2017构建工具-并重新安装了几次。

我在做什么错?

为什么要尝试使用我什至没有的VS2015构建工具?

[[UPD:]]即使从x64 Native Tools Command Prompt for VS2017执行此命令,结果也相同。

c++ cmake msbuild visual-studio-2017 icc
1个回答
0
投票

请检查文件“ C:\ Program Files(x86)\ MSBuild \ Microsoft.Cpp \ v4.0 \ V140 \ Microsoft.cpp.props”是否存在。

如果该项目是从VS2015移植的,请检查项目文件(.csproj / .vbproj)中的VisualStudioVersion参数,例如“ C:\ Users \ user001 \ Desktop \ myproject \ build \ CMakeFiles \ 3.16.2 \ VCTargetsPath。 vcxproj“。

Visual Studio project compatibility and VisualStudioVersion

© www.soinside.com 2019 - 2024. All rights reserved.