Visual Studio 2013 SDKDDKVer。h和相关错误

时间:2022-12-14 07:26:11

So I tried installing visual studio 2013 and building the default console application, and it gave me:

所以我试着安装visual studio 2013并构建默认的控制台应用程序,它给了我:

error C1083: Cannot open include file: 'SDKDDKVer.h': No such file or directory

So after about 7 hours, including installing VS on a brand new Windows 7 SP1 install on a virtual machine to see if that solved the problem (it did not), I found this solution:

因此,在大约7个小时后,我找到了这个解决方案:

In the project properties page, set configuration properties->vc++ directories to "C:\Program Files\Microsoft SDKs\Windows\v7.1A\Include"

在“项目属性”页面,设置配置属性->vc++目录到“C:\程序文件\Microsoft SDKs\Windows\v7.1A\Include”

set library directories to C:\Program Files\Microsoft SDKs\Windows\v7.1A\Lib

图书馆目录设置为C:\Program Files\Microsoft sdk \ Windows \ v7.1A \ Lib

and copy RC.Exe and RcDll.Dll from C:\Program Files\Microsoft SDKs\Windows\v7.1A\Bin to C:\Program Files\Microsoft Visual Studio 12.0\VC\bin

钢筋混凝土和副本。Exe和RcDll。Dll从C:\Program Files\Microsoft sdk \ Windows \ v7.1A C:\Program Files\Microsoft Visual Studio 12.0 \ Bin \ VC \ Bin

To my utter amazement, this actually worked! It now builds the default console program. However it is still giving me:

令我十分惊讶的是,这竟然奏效了!它现在构建默认的控制台程序。但是它仍然给了我:

warning MSB8003: Could not find WindowsSDKDir variable from the registry.  
TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.

And to my great irritation, I have to set these include/lib paths for every project.

令我非常恼火的是,我必须为每个项目设置这些include/lib路径。

So, here are my questions:

我的问题是:

1) Is this the normal procedure?! - ANSWER: No.

这是正常程序吗?——回答:没有。

2) If not, why am I (and lots of others, it seems) getting these problems? -ANSWER: Probably either (i) Didn't have Windows SDK 8.1 installed and/or (ii) Not online during install of visual studio.

2)如果没有,为什么我(似乎还有很多其他人)会遇到这些问题?-答:可能(i)没有安装Windows SDK 8.1, (ii)安装visual studio时没有在线。

3) Should I care about the aforementioned "warning MSB8003" or just ignore it? It seems to work now, after all...ANSWER: Oh dear, the above method really DOESN'T fix the problem properly.

3)我应该关注上述的“警告MSB8003”还是忽略它?毕竟,这似乎现在起作用了……回答:哦,天哪,上面的方法真的不能很好地解决问题。

4) How can I set the lib/include vc++ directories permanently for every project? Or is this not possible? ANSWER: You can, but you don't have to once you have the SDK 8.1 installed.

4)如何为每个项目设置lib/include vc++目录?或者这是不可能的?答:可以,但是安装了SDK 8.1之后就不需要这么做了。

That's it I guess, thanks for any help you can offer.

我想就是这样,谢谢你的帮助。

3 个解决方案

#1


3  

I faced the same problem, I solved it by defining an environment variable, restart visual studio 2013

我遇到了同样的问题,我通过定义一个环境变量重新启动visual studio 2013解决了这个问题

Add an environment variable "WindowsSDKDir" with value="path to the microsoft sdk"

添加一个环境变量“WindowsSDKDir”,值=“通往microsoft sdk的路径”

e.g. in my case

例如,在我的例子中

WindowsSDKDir=C:\Program Files(x86)\Microsoft SDKs\Windows\v7.1A

#2


0  

Downloading and installing the Windows 8.1 SDK (on a machine that is never online, grr...) solved all problems with no further action necessary. Probably the problem was caused by not being online during install of visual studio. I wonder why the VS 2013 installer doesn't come up with an explicit message before VS is installed. Something like : "EMERGENCY WARNING!!! YOU ARE NOT ONLINE!!! NOTHING WILL WORK PROPERLY!!! YOU ABSOLUTELY MUST INSTALL WINDOWS SDK 8.1 AT SOME POINT BEFORE ANYTHING WILL WORK!!!! I'M NOT KIDDING!!! REALLY!!!"

下载并安装Windows 8.1 SDK(安装在从未联机的机器上,grr…),无需进一步操作就能解决所有问题。可能问题是由于在安装visual studio时没有在线。我想知道为什么VS 2013的安装程序没有安装一个明确的消息。比如:“紧急警报!!!”你不是在线! ! !没有什么会正常工作! ! !你必须在某个时候安装WINDOWS SDK 8.1,然后一切才能正常工作!!!我不是在开玩笑! ! !真的! ! !”

Something like that anyway....Oh, and this is obviously the best answer, which I will mark as such if I'm allowed to...

这样无论如何....哦,这显然是最好的答案,如果我可以……

#3


0  

I just had this exact problem. After hours and hours in trying to find the problem by looking at different paths and trying to change them, uninstalling all MS products and reinstalling them etc. without any success, I found the solution to be to open the file C:\Users\{user}\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props and changing

我刚刚遇到了这个问题。在试图找到这个问题几个小时后通过观察不同的路径,试图改变他们,卸载所有女士产品并重新安装等没有任何成功,我找到的解决方案是打开文件C:\Users\微软当地{ user } \ AppData \ \ \ MSBuild \ v4.0 \ Microsoft.Cpp.Win32.user。道具和改变

<PropertyGroup>
  <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;C:\Program Files (x86)\BCGSoft\BCGControlBarPro\BCGCBPro;C:\Program Files (x86)\BCGSoft\BCGControlBarPro\BCGCBPro</IncludePath>
  <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;C:\Program Files (x86)\BCGSoft\BCGControlBarPro\bin;C:\Program Files (x86)\BCGSoft\BCGControlBarPro\bin</LibraryPath>
</PropertyGroup>

to

<PropertyGroup />

I don't know how this problem arose, but I found the solution by copying the file from my colleague's machine where it all worked fine. The problem might be caused to recent install and uninstall of BCGControlBarPro...

我不知道这个问题是怎么产生的,但是我从我同事的机器上拷贝文件找到了解决方案,在那里一切正常。问题可能是最近安装和卸载BCGControlBarPro…

#1


3  

I faced the same problem, I solved it by defining an environment variable, restart visual studio 2013

我遇到了同样的问题,我通过定义一个环境变量重新启动visual studio 2013解决了这个问题

Add an environment variable "WindowsSDKDir" with value="path to the microsoft sdk"

添加一个环境变量“WindowsSDKDir”,值=“通往microsoft sdk的路径”

e.g. in my case

例如,在我的例子中

WindowsSDKDir=C:\Program Files(x86)\Microsoft SDKs\Windows\v7.1A

#2


0  

Downloading and installing the Windows 8.1 SDK (on a machine that is never online, grr...) solved all problems with no further action necessary. Probably the problem was caused by not being online during install of visual studio. I wonder why the VS 2013 installer doesn't come up with an explicit message before VS is installed. Something like : "EMERGENCY WARNING!!! YOU ARE NOT ONLINE!!! NOTHING WILL WORK PROPERLY!!! YOU ABSOLUTELY MUST INSTALL WINDOWS SDK 8.1 AT SOME POINT BEFORE ANYTHING WILL WORK!!!! I'M NOT KIDDING!!! REALLY!!!"

下载并安装Windows 8.1 SDK(安装在从未联机的机器上,grr…),无需进一步操作就能解决所有问题。可能问题是由于在安装visual studio时没有在线。我想知道为什么VS 2013的安装程序没有安装一个明确的消息。比如:“紧急警报!!!”你不是在线! ! !没有什么会正常工作! ! !你必须在某个时候安装WINDOWS SDK 8.1,然后一切才能正常工作!!!我不是在开玩笑! ! !真的! ! !”

Something like that anyway....Oh, and this is obviously the best answer, which I will mark as such if I'm allowed to...

这样无论如何....哦,这显然是最好的答案,如果我可以……

#3


0  

I just had this exact problem. After hours and hours in trying to find the problem by looking at different paths and trying to change them, uninstalling all MS products and reinstalling them etc. without any success, I found the solution to be to open the file C:\Users\{user}\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props and changing

我刚刚遇到了这个问题。在试图找到这个问题几个小时后通过观察不同的路径,试图改变他们,卸载所有女士产品并重新安装等没有任何成功,我找到的解决方案是打开文件C:\Users\微软当地{ user } \ AppData \ \ \ MSBuild \ v4.0 \ Microsoft.Cpp.Win32.user。道具和改变

<PropertyGroup>
  <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;C:\Program Files (x86)\BCGSoft\BCGControlBarPro\BCGCBPro;C:\Program Files (x86)\BCGSoft\BCGControlBarPro\BCGCBPro</IncludePath>
  <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;C:\Program Files (x86)\BCGSoft\BCGControlBarPro\bin;C:\Program Files (x86)\BCGSoft\BCGControlBarPro\bin</LibraryPath>
</PropertyGroup>

to

<PropertyGroup />

I don't know how this problem arose, but I found the solution by copying the file from my colleague's machine where it all worked fine. The problem might be caused to recent install and uninstall of BCGControlBarPro...

我不知道这个问题是怎么产生的,但是我从我同事的机器上拷贝文件找到了解决方案,在那里一切正常。问题可能是最近安装和卸载BCGControlBarPro…