的Visual Studio 2013社区奇怪的错误(Visual Studio 2013 Comm

2019-10-23 11:36发布

我最近安装了Visual Studio 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'

如何解决这些问题? 我试了很多办法,但没有运气。

Answer 1:

Go to control panel and go to uninstall program.

Choose your visual studio community edition update 4. Select change or repair, if it's there. If it opens to the Visual Studio window then select repair there.

Select repair.

Keep your internet connection on while you do this, so your sdk and platform tools can be updated.

If this doesn't work, there are some links to altering the registry:

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



文章来源: Visual Studio 2013 Community weird errors