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
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
to
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...
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
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:
If you have other SDK packages installed you may have another folders with SDKDDKVer.h:
In your project setting you should have the following paths for includes:
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.
If above information couldn't solve your problem, I am proposing below steps from my VS2013 experiences:
After that configuration I had problem about rc.exe link error. For this problem one more thing is needed:
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."
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.