SDKDDKVer.h missing, but WinSDK installed? (c++ header issues)
Asked Answered
R

9

13

So I recently returned to VC++ with .NET 4.5 (Visual Studio 2012 professional) due to various irrelevant reasons on a new PC after spending an eternity with web dev, python and c#. I'm pretty comfortable with the language as a whole, it's f**king beautiful in terms of syntax and I love the memory management freedom, pointers and references. I start up again with a "hello world" thing and BAM! Error.

As many other people get with this problem, I'm receiving the IntelliSense error when I try to compile and run:

cannot open source file "SDKDDKVer.h"" and the fatal error: "error C1083: Cannot open include file: 'SDKDDKVer.h': No such file or directory

I also have Visual Studio 2010 (C# Express) installed, perhaps that's screwing up some of my stuff. I've confirmed that my VC++ directories for incl and lib are all correct and that recommended by Microsoft and virtually any C++ developer. I attempted to install the most recent WinSDK (8.1) to get the header and all of it's functionality but I'm about 110% certain it's not in there. I'm installing the SDK for Win7 right now in hopes that it might reside in there (it's sure taking a long time though.)

My PC has the issue of terminally blue-screening only for any issue to be resolved upon leaving the machine alone for 15 minutes, so maybe it's a hard-drive issue?

Can any of you help? Absolutely any heads up, condescending, obvious or not will be appreciated a ton, and thanks for reading anyway.

EDIT: @MichaelBurr asked for the build log and I couldn't post it in its entirety at the bottom, so I figured I'd add it here.

Build started 14/03/2014 00:34:11.
 1>Project "c:\Users\Brandon\documents\visual studio 2012\Projects\ConsoleApplication4\ConsoleApplication4\ConsoleApplication4.vcxproj" on node 2 (Build target(s)).
 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(344,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
 1>ClCompile:
     C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yc"stdafx.h" /Fp"Debug\ConsoleApplication4.pch" /Fo"Debug\\" /Fd"Debug\vc110.pdb" /Gd /TP /analyze- /errorReport:prompt stdafx.cpp
     stdafx.cpp
 1>c:\users\brandon\documents\visual studio 2012\projects\consoleapplication4\consoleapplication4\targetver.h(8): fatal error C1083: Cannot open include file: 'SDKDDKVer.h': No such file or directory
 1>Done Building Project "c:\Users\Brandon\documents\visual studio 2012\Projects\ConsoleApplication4\ConsoleApplication4\ConsoleApplication4.vcxproj" (Build target(s)) -- FAILED.

Build FAILED.

Time Elapsed 00:00:00.12

Robillard answered 13/3, 2014 at 20:46 Comment(7)
#include <sdkddkver.h> without the double quotes? Does the code completion show you this file when opening the < and typing sdk?Noise
Are you compiling from the command line or in the IDE? Is the INCLUDE environment variable set to something? Did you run vsvars32.bat? Try passing in the /showIncludes options to see where it's getting include files from. Post the command line you're using and/or the build log. Whew! Did I forget anything?Louie
@MichaelBurr Attempting to build to no yield, the include statements in vc++ directories are $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); No build log due to inability to run. @Noise No double quotes, and code completion shows me nothing: #include <SDKDDKVer.h> and if I type ` #include <sdk` nothing happens.Robillard
Even if the build fails you should still get a <project-name>.log file in the output directory (usually named Debug, x64\Debug, Release, etc depending on your project settings). I get one even from a build that crashes the compiler.Louie
Yep, I'm totally a noob and was looking in COMPLETELY the wrong place -_-... My bad.Robillard
I'm sorry, the log doesn't actually show what I'm looking for anyway - I'll have to ask MS why. Does C:\Program Files (x86)\Windows Kits\8.0\Include\shared\sdkddkver.h actually exist? Does $(WindowsSDK_IncludePath) actually point to C:\Program Files (x86)\Windows Kits\8.0\Include\shared? You may have to go to Configuration Properties | VC++ Directories | Include Directories then click on the <Edit...> dropdown then the Macros>> button to see the value. VS should make this stuff easier, I think.Louie
It did not as a matter of fact, I re-installed the thing and then I received another error: Error 103 error LNK1104: cannot open file 'kernel32.lib' I'm kind of worried about my HDD at this point.Robillard
I
0

Do you have the same problem the blank project you posted? I have tried and built your project using Windows 7 32 and 64 bit and XP 32 bit. All builds fine, no problem with finding SDKDDKVer.h.

You must have some problem with your dependencies path settings.

It is possible that you have transferred VS settings from one installation of VS to another, possibly from 32-bit to 64-bit (or vice versa) machine? If this is a case, remember that your path may include wrong folders names. For 32-bit system all applications are installed as default to C:\Program Files, while on 64-bit machine all 32bit apps are installed to Program Files (x86). This is a case for VS. All include files are in:

  • C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include - original VS installation
  • C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include - after installing 7.1 VS SDK

If you have other SDK packages installed you may have another folders with SDKDDKVer.h:

  • C:\Program Files (x86)\Windows Kits\8.0\Include\shared
  • C:\Program Files (x86)\Windows Kits\8.1\Include\shared
  • C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
  • C:\Program Files\Microsoft SDKs\Windows\v7.0\Include
  • C:\Program Files\Microsoft SDKs\Windows\v7.1\Include

In your project setting you should have the following paths for includes:

  • $(VCInstallDir)include
  • $(VCInstallDir)atlmfc\include
  • $(WindowsSDK_IncludePath)

Note macros used. They should be inherited from parent’s default setrtings. You may have overridden path settings in Property manager, by editing setting saved in Microsoft.Cpp.Win32.user.props file.

It may have happened if your project is converted from earlier versions of VS.

Imtiaz answered 15/3, 2014 at 18:57 Comment(0)
C
19

If above information couldn't solve your problem, I am proposing below steps from my VS2013 experiences:

  1. Select Project Properties>Configuration>VC++ Directories>Include Directories and add that: c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include
  2. Select Project Properties>Configuration>VC++ Directories>Library Directories and add that: c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib

After that configuration I had problem about rc.exe link error. For this problem one more thing is needed:

  1. copy RC.exe and RcDll.dll files from C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin and past them to C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin After all those configuration steps, you can build a simple "Hello World!" example and run if you are lucky.
Ciceronian answered 3/12, 2014 at 14:32 Comment(2)
That solved my problem to run a simple Hello World Application ! :)Bonzer
THANK YOU! This finally fixed the problem! I think it may be a little bit less scary if you make the following minor adjustments: 1. Add $(WindowsSdkDir)\Include (Include Directories) 2. Add $(WindowsSdkDir)\Lib (Library Directories) 3. Add $(WindowsSdkDir)\Bin (Executable Directories)Vanish
T
4

This one worked for me: "recently had this problem when I converted a solution from VS2010 to VS2013. I solved it by simply checking the "Inherit from parent or project defaults" check box under Project Properties>Configuration>VC++ Directories>Include Directories for all configurations of each project."

Twoup answered 27/12, 2015 at 7:3 Comment(0)
P
3

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

<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...

Pterosaur answered 23/4, 2015 at 8:44 Comment(1)
This is brilliant, exactly my problem. You are awesome!Tiller
S
3

I know that there are several answers here to this question, but I wanted to explain what solved the issue for me. I searched and searched and searched and didn't find much good material. The solution for me was to right click on my project, the go to properties. In the properties tab, I changed the WindowsSDK Version to the only one that I had installed. That fixed the issue.

Why did this occur? I am not sure, but it happened after Visual Studio performed an update and after Windows Update installed the newest build of Windows 10. My guess is that when this happened, the SDK version in the project did not match the SDK installed.

I hope this saves someone in the future hours of searching!

Sela answered 13/4, 2017 at 15:10 Comment(0)
P
2

The Mustafa Kemal's answer is correct but if you don't want to add this directory and library for each VC++ project seperately, you should define them as system variables in Environment Variables of Windows and then restart computer.

Variable Name: WindowsSDK_IncludePath, Variable Value: c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include.

and

Variable Name: WindowsSDK_LibraryPath_x86, Variable Value: c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib

Predominant answered 26/4, 2016 at 7:46 Comment(0)
A
1

This sometimes happens when you add a path for your include or library and delete the original ones that are already written in the project properties.

You should not remove the old path for include or lib directories, such as $(VCInstallDir)include; $(VCInstallDir)altmfc\include; $(WindowsSdkDir)include; $(FrameworkSDKDir)\include;

The same thing is for lib path just replace each include by lib.

Best Regards

Amerind answered 13/6, 2014 at 9:24 Comment(0)
M
1

I recently had this problem when I converted a solution from VS2010 to VS2013. I solved it by simply checking the "Inherit from parent or project defaults" check box under Project Properties>Configuration>VC++ Directories>Include Directories for all configurations of each project.

Mestee answered 22/4, 2015 at 16:6 Comment(0)
I
0

I am running 2008, 2010, 1012 and 2013 installed on the same machine - Windows 7 and XP 32 and 64-bit, 7 32-bit, without any problem.

Are you trying to build a project created by another version of VS?

It looks like you have a problem with dependencies set in your project or you have a problem with SDK version that is set to the wrong version.

If you create another project, for example, dialog based application; does this problem persist? You do not have to run any batch file.

  • Open project properties (right click on the project and select properties).

  • Select General under Configuration Properties

  • Check the Platform Toolset on in the right pane. It should not be set to Visual Studio 2008 (V90).

Try rebuilding. If problem persists, share your project.

Zip it and use some of the share services to post it (dropbox for example).

Imtiaz answered 14/3, 2014 at 15:6 Comment(1)
The problem persists across all projects, and it's v110 (visual studio 2012 or something. I'll send you a blank project: dropbox.com/s/cdek3btb5f2ha3a/ca4.zipRobillard
I
0

Do you have the same problem the blank project you posted? I have tried and built your project using Windows 7 32 and 64 bit and XP 32 bit. All builds fine, no problem with finding SDKDDKVer.h.

You must have some problem with your dependencies path settings.

It is possible that you have transferred VS settings from one installation of VS to another, possibly from 32-bit to 64-bit (or vice versa) machine? If this is a case, remember that your path may include wrong folders names. For 32-bit system all applications are installed as default to C:\Program Files, while on 64-bit machine all 32bit apps are installed to Program Files (x86). This is a case for VS. All include files are in:

  • C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include - original VS installation
  • C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include - after installing 7.1 VS SDK

If you have other SDK packages installed you may have another folders with SDKDDKVer.h:

  • C:\Program Files (x86)\Windows Kits\8.0\Include\shared
  • C:\Program Files (x86)\Windows Kits\8.1\Include\shared
  • C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
  • C:\Program Files\Microsoft SDKs\Windows\v7.0\Include
  • C:\Program Files\Microsoft SDKs\Windows\v7.1\Include

In your project setting you should have the following paths for includes:

  • $(VCInstallDir)include
  • $(VCInstallDir)atlmfc\include
  • $(WindowsSDK_IncludePath)

Note macros used. They should be inherited from parent’s default setrtings. You may have overridden path settings in Property manager, by editing setting saved in Microsoft.Cpp.Win32.user.props file.

It may have happened if your project is converted from earlier versions of VS.

Imtiaz answered 15/3, 2014 at 18:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.