Visual Studio 希望使用错误的平台工具集进行构建 [英] Visual Studio wants to build with wrong platform toolset

查看:30
本文介绍了Visual Studio 希望使用错误的平台工具集进行构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将一个解决方案从 VS2010 升级到 VS2012.我用其他解决方案做到了这一点,而且效果很好.

I have upgraded a solution from VS2010 to VS2012. I did that with other solutions, and it worked fine.

但是现在当我尝试构建更新的解决方案时,编译器告诉我:

But now when I tried to build the updated solution, the compiler tells me:

Error 1596  error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools.    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets   42  5   praat3

我不知道为什么编译器会尝试使用 VS2010.

I don't know why the compiler tries to use VS2010.

在项目属性页中,我在调试源文件"下看到以下条目:

In the project property pages, I see under "Debug source files" the following entries:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\
etc.

此外,如果我将Platformtoolset"设置为从上面的项目或项目标准继承",则默认为v100".我认为这是关于这里出了什么问题的最好提示.

Also, if I set the "Platformtoolset" to "Inherit from project above or project standard", it defaults to "v100". I think this is the best hint about what goes wrong here.

偶然地,我设法打开了 Microsoft.Cpp.Platform.targets 文件,我看到那里列出了 v90 和 v100,但没有列出 v110.

By accident I managed to open up the Microsoft.Cpp.Platform.targets file, and I see that v90 and v100 are listed there, but not v110.

只使用 VS2012 的人可以看看那个文件吗?

Could somebody who uses only VS2012 perhaps have a look at that file?

这就是我的样子:

<!--
***********************************************************************************************
Microsoft.Cpp.Platform.targets

WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
          created a backup copy.  Incorrect changes to this file will make it
          impossible to load or build your projects from the command-line or the IDE.

This file defines the steps/targets required to build Visual C++ projects
specifically on x86 platforms.

Copyright (C) Microsoft Corporation. All rights reserved.
***********************************************************************************************
-->

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ToolsetTargetsFound Condition="Exists('$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\$(PlatformToolset)\Microsoft.Cpp.$(Platform).$(PlatformToolset).targets')">true</ToolsetTargetsFound>
    <VCTargetsPathEffective Condition="'$(ToolsetTargetsFound)' == 'true'">$(VCTargetsPath)</VCTargetsPathEffective>
  </PropertyGroup>

  <!-- Import Before -->
  <Import Condition="Exists('$(VCTargetsPath)\Platforms\$(Platform)\ImportBefore')" Project="$(VCTargetsPath)\Platforms\$(Platform)\ImportBefore\*.targets"/>
  <!-- Import platform toolset file if found in this version -->
  <Import Condition="'$(ToolsetTargetsFound)' == 'true'" Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\$(PlatformToolset)\Microsoft.Cpp.$(Platform).$(PlatformToolset).targets" />
  <!-- Try to find the toolset in older versions  -->
  <Import Condition="'$(ToolsetTargetsFound)' != 'true' and '$(MinSupportedVCTargetsVersion)' != 'v110'" Project="Microsoft.Cpp.Platform.Redirect.targets" />

  <PropertyGroup>
    <PrepareForBuildDependsOn>PlatformPrepareForBuild;$(PrepareForBuildDependsOn)</PrepareForBuildDependsOn>
  </PropertyGroup>

  <Target Name="PlatformPrepareForBuild" DependsOnTargets="$(PlatformPrepareForBuildDependsOn)">
    <PropertyGroup>
      <ConfigurationPlatformExists Condition="'%(ProjectConfiguration.Identity)' == '$(Configuration)|$(Platform)'">true</ConfigurationPlatformExists>
    </PropertyGroup>

    <!-- Error out when building an platform that is not set in the project file -->
    <VCMessage Code="MSB8013" Type="Error" Arguments="$(Configuration)|$(Platform)" Condition="'$(DesignTimeBuild)'!='true' and '$(ConfigurationPlatformExists)' != 'true'"/>

    <!-- Check if toolset exists in Visual Studio 2010 or Dev11 -->
    <VCMessage Code="MSB8020" Type="Error" Arguments="$(_PlatformToolsetShortNameFor_v100);$(PlatformToolset)" Condition="'$(DesignTimeBuild)'!='true' and '$(ToolsetTargetsFound)' != 'true' and '$(PlatformToolset)' == 'v100'" />
    <VCMessage Code="MSB8020" Type="Error" Arguments="$(_PlatformToolsetShortNameFor_v90);$(PlatformToolset)" Condition="'$(DesignTimeBuild)'!='true' and '$(ToolsetTargetsFound)' != 'true' and '$(PlatformToolset)' == 'v90'" />
    <VCMessage Code="MSB8020" Type="Error" Arguments="$(PlatformToolset);$(PlatformToolset)" Condition="'$(DesignTimeBuild)'!='true' and '$(ToolsetTargetsFound)' != 'true' and '$(PlatformToolset)' != 'v90' and '$(PlatformToolset)' != 'v100'" />
  </Target>

  <!-- Import After -->
  <Import Condition="'$(ToolsetTargetsFound)' == 'true' and Exists('$(VCTargetsPath)\Platforms\$(Platform)\ImportAfter')" Project="$(VCTargetsPath)\Platforms\$(Platform)\ImportAfter\*.targets"/>
</Project>

感谢您的帮助.

推荐答案

在C/C++"下,附加包含目录"中有一个库.我没有使用这个库,但它被引用了.我删除了这个库.

Under "C/C++", there was a lib in "Additional include directories". I did not use this lib, but it was referenced. I removed this lib.

我还删除了注册表中的所有studio 2010"条目.

I also deleted all "studio 2010" entries in the registry.

这篇关于Visual Studio 希望使用错误的平台工具集进行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆