Visual Studio 2013社区奇怪的错误

时间:2015-06-21 11:31:59

标签: visual-studio visual-c++ visual-studio-2013

我最近安装了Visual Studio Community 2013和更新4,当我尝试构建项目时,我遇到了这些错误(见下文):

C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(362,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
1>  main.cpp
1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\sal_supp.h(57): warning C4005: '__useHeader' : macro redefinition
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\sal.h(2886) : see previous definition of '__useHeader'
1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\specstrings_supp.h(77): warning C4005: '__on_failure' : macro redefinition
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\sal.h(2896) : see previous definition of '__on_failure'

如何解决?我尝试了很多方法,但没有运气。

1 个答案:

答案 0 :(得分:0)

转到控制面板,然后转到卸载程序。

uninstall

选择您的visual studio社区版更新4.选择更改或修复(如果有)。如果它打开到Visual Studio窗口,则在那里选择修复。

controlPanelChoice

选择修复。

VSRepair

在执行此操作时保持互联网连接,以便更新您的sdk和平台工具。

如果这不起作用,则有一些改变注册表的链接:

https://stackoverflow.com/a/24478856/3956566

https://social.msdn.microsoft.com/Forums/vstudio/en-US/48a4500c-2c48-43dd-822b-10e83258d18b/warning-msb8003-could-not-find-windowssdkdir-variable-from-the-registry-targetframeworkversion-or?forum=visualstudiogeneral

How to set SGEN toolpath in Msbuild to target 3.5 framework

https://code.google.com/p/gyp/issues/detail?id=457