项目文件包含ToolsVersion =“ 15.0”。该工具集可能未知或丢失

时间:2018-11-27 15:45:20

标签: c++ visual-studio cmake msbuild

我正在尝试编译一个开源项目以在Windows(this one)上使用它。我使用CMake,然后使用__build.cmd bash构建项目。该代码用cpp编写。

我刚刚安装了Visual Studio 2017社区版(要求是2013或更高版本)。

尝试编译此代码(使用__build.cmd)时,出现以下错误:

Release|Win32
Build started 27/11/2018 17:15:25.
     1>Project "C:\Users\SHIRM.ARGUS\out_git\gptp\windows\gptp.sln" on node 1 (Clean;Build target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Release|Win32".
       ValidateProjects:
         The project "ALL_BUILD" is not selected for building in solution configuration "Release|Win32".
     1>Project "C:\Users\SHIRM.ARGUS\out_git\gptp\windows\gptp.sln" (1) is building "C:\Users\SHIRM.ARGUS\out_git\gptp\windows\ZERO_CHECK.vcxproj" (2) on node 1 (Clean target(s)).
       Project file contains ToolsVersion="15.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular
       ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=291333.
     2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppClean.targets(76,5): error MSB4062: The "CppClean" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Vi
       sual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one
       of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that impleme
       nts Microsoft.Build.Framework.ITask. [C:\Users\SHIRM.ARGUS\out_git\gptp\windows\ZERO_CHECK.vcxproj]
     2>Done Building Project "C:\Users\SHIRM.ARGUS\out_git\gptp\windows\ZERO_CHECK.vcxproj" (Clean target(s)) -- FAILED.
     1>Done Building Project "C:\Users\SHIRM.ARGUS\out_git\gptp\windows\gptp.sln" (Clean;Build target(s)) -- FAILED.

Build FAILED.

我看到问题可能出在Project file contains ToolsVersion="15.0".... Treating the project as if it had ToolsVersion="4.0"

重点是-据我了解,我拥有正确的MSBuild版本。例如,我在15.0中有一个名为C:\Program Files (x86)\MSBuild的文件夹。 另一方面,注册表中2.0下只有3.54.0Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions文件夹(15.0本身也不在MSBuild注册表中)

尝试解决此问题,我从here下载了MSBuild。这将名为14.0的文件夹添加到C:\Program Files (x86)\MSBuild和注册表位置,但是错误仍然相同(!)[即使我删除了所有Cmake结果并再次使用它]。

由于我对Windows的了解不多,而且我没有编写任何我想使用的代码,所以我在这里迷路了。

任何想法我该怎么办?谢谢!

修改

我认为这可能与CMake选项有关。有一个选项可以选择我不使用的工具版本。也许我应该选择一些东西? (我尝试了14.0、4.0、14,但顺便说一句不起作用)-

enter image description here

0 个答案:

没有答案