Can't get visual studio C++ include file 'excpt.h' to get installed - c++

I'm trying to compile a visual studio C++ project and I can't get anywhere because of the compiler reporting "Cannot open include file: 'excpt.h': No such file or directory". The problem has been reported numerous times on the Internet but I can't find any help regarding my particular situation. The problem is not that the include path of the project are not correctly setup, the problem is that this include file (and probably a bunch of other files) are just missing from my computer. There is no such file on my hard drive. So I tried installing Windows SDK 7.1. The file is not inside the installed SDK (although it should be). I tried repairing the install, uninstall it, reinstall it... all numerous time. I also try to install, repair, uninstall, reinstall Visual Studio 2010 professional numerous time, with and without the Windows SDK installed. I even tried uninstalling the professional version to install the express VC++... nothing seems to work, no 'excpt.h' never get installed on my computer. I am clueless... someone has a hint of a solution? I'm on Windows 7.
As supplementary information, note that 'excpt.h' is included in by "windows.h". Also, the "excpt.h" file is normally installed with the Windows SDK under a path like "c:\program files (x86)\microsoft sdks\windows\v7.1\include\" and with Visual Studio under a path like "C:\Program Files\Microsoft Visual Studio 10.0\VC\include\".
EDIT: If it might help, I might add that the folder C:\Program Files\Microsoft Visual Studio 10.0\VC\include related my Visual Studio install has only two files... which is certainly not normal!!! However, I can't find any ways to get the installer to install all the .h files that should appear in this repertory.

See if you have it at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\excpt.h Check to be sure that the system include-paths are correct in Visual Studio. If all else fails, uninstall everything, all SDK's, etc., and re-install Visual C++.
Third party search programs do a better job than the Windows one for finding things. Try Agent Ransack. It's free.

For those who have the same problem, here is the solution I found after about 10h of install/uninstall/cleaning cycles... I've uninstalled completely visual studio using this. After that, using the control panel, I've uninstalled the Windows SDK and everything that can be associated with it or with visual studio (e.g. .NET framework). Then, I've removed all the left overs by manually deleting the visual studio and the Windows SDK folders located in C:/Program files. Finally, I deleted all the entries related to the Windows SDK or to Visual Studio in the registry (they are located in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft). Then, I reinstalled Visual Studio... and it was finally working correctly. I should add that I restarted and cleaned the registry using CCleaner after any install or uninstall step.

I had this problem with a project that had been updated to VS2017 from VS2015.
This was a header included via windows.h. I knew this header should have no problems as I had other projects created directly in VS2017 that used windows.h.
Another symptom was that the intellisense was highlighting includes of standard headers (e.g string, vector etc), although these were not generating compile errors.
The fix for me was similar to VS 2010 Cannot open source file “string”.
Initially, I retargeted the project, hoping this would help (right-click the project, select retarget projects), but this did not in itself cure the problem.
I then took a working project and copied the include directories from project properties->Configuration Properties->VC++ Directories and used these to replace the same property for my broken project. This fixed the problem.
Initially, the value for this property was
$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);
The replacement value was
$(VC_IncludePath);$(WindowsSDK_IncludePath);

I had the same problem, and tried the answer given by OP, but it did not work. However, copying the contents of C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC (specifically bin, lib, and include) from a machine that did work to this machine worked.

It seems the Visual Studio 2012 installer is buggy when it comes to installing into a different drive letter than C:. I have installed the VS2012 into the D: drive and got the same error. I found that for some unknown reason the installer put some of the files into the correct location at:
D:\Program Files (x86)\Microsoft Visual Studio 11.0
but the remaining files were at
C:\Program Files (x86)\Microsoft Visual Studio 11.0
so I have moved the files from the C: into the D: location and it fixed the problem.

Some situation cause such problem. If you have uninstalled vs2010. you lost platform C++ binaries for .net framework 4 forever. You have to delete all of VS 2010 2012 2013, clean system up and its accompany components and reinstall them from scratch.
Or you can download this package. Include them in your project that may solve your problem properly.

one simeple way,just copy vc directory(C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC) from other computer

Fixing your Visual Studio installation is a good idea, but you don't necessarily need to re-install the same old version of VS. I uninstalled VS 2015, then modified my VS 2017 installation to add the VC++ v140 build tools, and now my project builds.

Related

fxc.exe not found by VS2017 in windows 10

I'm going to use the HelixToolkit.SharpDX with VS2017 in my Windows 10 workstation, when I attempt to build the solution, it will prompt the Assertion Failed error with "No fxc.exe found".
I have checked the installation option, Windows SDK has been included, nand I have downloaded and install again, and I can see the fxc.exe in "C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64" & "C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86" folders, so it should be available for any windows version, but unfortunately, the same error reported.
However, I have also installed VS2017 in another Windows 7 machine, it works fine, and it has the fxc.exe in the same folder as my Windows 10 workstation, but it can be located by VS2017.
Is there any setting in VS2017 to locate the fxc.exe?
Or how can I fix this issue?
Copy fxc.exe in Bin\10.0.xxx\x86 to Bin\x86 to fix this issue. Because the HLSL compile tool hard coded the path.
One can find solution on helix toolkit github page.
Visual Studio 2017. Windows 10 SDK.
Missing fxc.exe issue with newest Windows 10 SDK:
Copy fxc.exe in C:\Program Files (x86)\Windows
Kits\10\Bin\10.0.xxx\x86 to C:\Program Files (x86)\Windows
Kits\10\bin\x86 to fix this issue. Because the HLSL compile tool hard
coded the path.
This seems to have been fixed in Visual Studio 2019 16.0.2, as of writing. Just have to make sure $(WindowsSDK_ExecutablePath) is pointing to the correct SDK directory and the build version that matches with the Targeted Platform in the Project Properties page.
https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/a3032567-d8e7-4b01-81b7-0612047a6299/why-do-we-need-to-copypaste-fxcexe-from-bin100xxxxx0x86-to-binx86-directory-in-the?forum=windowssdk
Second post answered:
The executables that the C++ build process uses from the Windows SDK directory are MIDL.exe, MT.exe and RC.exe. If you digitally sign your executables then you will find signtool.exe here too. So I am kind of surprised that it finds some critical build tools correctly but others it fails to find.
My suggestion would be:
1) Verify that you are having this problem with your project in Visual Studio 2019 16.0.2 (the latest version at the time of writing) or Visual Studio 2019 Preview (16.1 Preview 1 at the time of writing). This is to check that if this has been found to be a bug, then it could have been fixed.
2) Create a completely new project. Without touching the project's executable path, try to create a sample that shows this behaviour. It doesn't need to be a full sample, just complete enough to show that Visual Studio fails to find fxc.exe.
3) If doing all of this shows that Visual Studio fails to find fxc.exe, then through Visual Studio 2019, report it as a bug.
But I will mention that a naïve test on my end shows that Visual Studio 2019 can compile HLSL shaders without any issues using the 18362, 17763 and 17134 SDKs. These were tested because these are the versions that I have installed.

Error while trying to compile simple C++ code in Visual C++ 2010 [duplicate]

I've installed Visual Studio 2012 Release Preview, and it appears to be fine, but now when I try to use Visual Studio 2010 to compile C++ projects, I get the following error message:
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
I'm not 100% sure of this, but it seems to be related to projects that have .rc (resource) files in them.
I've tried repairing Visual Studio 2010 from Add/Remove programs and rebooting, but this has no effect.
I also get the same error if I use Visual Studio 2012 RC to compile the C++ projects when set to use the Visual Studio 2010 toolset. Upgrading to the Visual Studio 2011 toolset fixes the problem (but of course I don't want to do this for production code).
Update: I've uninstalled Visual Studio 2012, rebooted, and the problem still persists! Help!
This MSDN thread explains how to fix it.
To summarize:
Either disable incremental linking, by going to
Project Properties
-> Configuration Properties
-> Linker (General)
-> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
or install VS2010 SP1.
Edits (#CraigRinger): Note that installing VS 2010 SP1 will remove the 64-bit compilers. You need to install the VS 2010 SP1 compiler pack to get them back.
This affects Microsoft Windows SDK 7.1 for Windows 7 and .NET 4.0 as well as Visual Studio 2010.
If disabling incremental linking doesn't work for you, and turning off "Embed Manifest" doesn't work either, then search your path for multiple versions of CVTRES.exe.
By debugging with the /VERBOSE linker option I found the linker was writing that error message when it tried to invoke cvtres and it failed.
It turned out that I had two versions of this utility in my path. One at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cvtres.exe and one at C:\Windows\Microsoft.NET\Framework\v4.0.30319\cvtres.exe. After VS2012 install, the VS2010 version of cvtres.exe will no longer work. If that's the first one in your path, and the linker decides it needs to convert a .res file to COFF object format, the link will fail with LNK1123.
(Really annoying that the error message has nothing to do with the actual problem, but that's not unusual for a Microsoft product.)
Just delete/rename the older version of the utility, or re-arrange your PATH variable, so that the version that works comes first.
Be aware that for x64 tooling builds you may also have to check C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64 where there is another cvtres.exe.
Check the version of cvtrs.exe:
dir "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe"
Wrong version:
date: 03/18/2010
time: 01:16 PM
size: 31,048 bytes
name: cvtres.exe
Correct version:
date: 02/21/2011
time: 06:03 PM
size: 31,056 bytes
name: cvtres.exe
If you have wrong version you should copy the correct version from:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe
and replace the one here:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
i.e.
copy "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe"
According to this thread in MSDN forums: VS2012 RC installation breaks VS2010 C++ projects, simply, take cvtres.exe from VS2010 SP1
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
or from VS2012
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe
and copy it over the cvtres.exe in VS2010 RTM installation (the one without SP1)
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
This way, you will effectively use the corrected version of cvtres.exe which is 11.0.51106.1.
Repeat the same steps for 64-bit version of the tool in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cvtres.exe.
This solution is an alternative to installation of SP1 for VS2010 - in some cases you simply can't install SP1 (i.e. if you need to support pre-SP1 builds).
If you have installed Visual Studio 2012 RC, then it installed .NET 4.5 RC.
Uninstall .NET 4.5 RC, and install the version you need (4.0 for VS 2010). This should clear up any problems you are having.
This solved the same problem. There is no need to uninstall Visual Studio.
It's because of .NET Framework 4.5 is replacing .NET Framework 4.0.
I uninstalled Visual Studio 2010 several times with no luck. When I removed .NET Framework 4.5 and reinstalled Visual Studio 2010 it went fine.
See Uninstall Visual Studio 11 completely to do a fresh install.
For me, setting 'Generate Manifest' to 'No' fixed it. (Also fixed with /INCREMENTAL:NO)
If you're using x64, here's a resource will help:
This happens because Microsoft .NET 4.5 is incompatible with Visual C++ 10. The workaround is to ensure that you run the .NET version of cvtres.exe rather than the Visual C++ version. I did this by renaming the Visual C++ versions of those files and copying the .NET versions in their place.
1. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
2. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cvtres.exe
1. C:\windows\Microsoft.NET\Framework\v4.0.30319\cvtres.exe
2. C:\windows\Microsoft.NET\Framework64\v4.0.30319\cvtres.exe
I solved this problem eventually by doing a full uninstall of VS2012 RC, followed by a full uninstall of VS2010, then a reinstall from scratch of VS2010.
It took forever, but I'm now able to compile C++ projects in VS2010 again.
The issue was magically resolved for me by removing .NET 4.5, and replacing it with .NET 4.0. I then had to repair Visual Studio 2010 - it being corrupted along the way somehow.
I had previously installed, and then un-installed, Visual Studio 2012 - which may be related to the issue.
I have not installed Visual Studio 2012, but I still got this error in Visual Studio 2010. I got this resolved after installing Visual Studio 2010 SP1.
I had the same problem with Microsoft Visual Studio 2010 Ultimate and it was solved by the method described in this youtube video
The video suggests to rename the file cvtres.exe in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin (in my Win7X64 matchine) to cvtres-old.exe
It didn't work for me after Enable Incremental Linking -> "No (/INCREMENTAL:NO)", but it works for me after I deleted the rc file.
+1 to user Short for an answer that worked for me!
I tried to do some debugging of this with msbuild /v:diag, and I'm seeing that MSBuild is trying to embed a manifest in the executable, with <somename>.dll.embed.manifest.res on the linker command line, where that is a resource file built from <somename>.dll.embed.manifest. But the manifest file is an empty Unicode text file. (That is, a two-byte file with the Unicode 0xFEFF prefix)
So the root problem seems to have something to do with that manifest file not being generated, or it being used when <somename>.dll.intermediate.manifest should have been used.
An alternate solution seems to be to turn off the "Embed Manifest" option under Properties, Manifest Tool, Input and Output.
To summarize:
Step1
Project Properties
-> Configuration Properties
-> Linker (General)
-> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
if step1 not work, do Step2
Project Properties
-> Configuration Properties
-> Manifest Tool (Input and Output)
-> Enable Incremental Linking -> "No"
if step2 not work, do Step3
Copy file one of:
C:\Program Files (x86)\Microsoft Visual Studio
11.0\VC\bin\cvtres.exe
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\bin\cvtres.exe
C:\Program Files (x86)\Microsoft Visual Studio
13.0\VC\bin\cvtres.exe
Then, replace to C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\bin\cvtres.exe
With me, do 3 step it work
As of January 2014, for some reasons I got installed .NET Framework 4.5.1, I don't know if due to a third party software installation or to an automatic update.
On January 29th, I got installed one component and I started receiving the
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
message. At that time, I solved by avoiding the incremental link.
On Jan. 31st, I got installed another component of .NET Framework 4.5.1 and the incremental link trick did not work anymore. I then installed the Visual Studio 2010 SP1, but afterwards the problem became:
Error 6 error LNK1104: cannot open file 'msvcrtd.lib'.
I think the SP1 messed up my Visual Studio 2010 installation.
So I uninstalled .NET Framework 4.5.1, installed .NET Framework 4.0 and uninstalled and then reinstalled Visual Studio 2010. That worked for me.
Even inspite of installing Service pack you are getting the error then try removing/renaming the cvtres.exe in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin folder. This has worked for me.
I set Enable Incremental Linking to "No (/INCREMENTAL:NO)" and it doesn't work for me.
Next I've changed:
Project Properties
-> Configuration Properties
-> General
-> Platform Toolset -> "Visual Studio 2012 (v110)"
and it works for me :)
Reinstalling CMake worked for me. The new copy of CMake figured out that it should use Visual Studio 11 instead of 10.
I was using the Windows SDK for core Win32 programming and had .NET 4.5 installed for "unknown" reasons. I have uninstalled that and installed 4.0 like previous answers and yeah, it worked for me too.
Just am flabbergasted that I had to use the useless .NET framework for building Win32 apps using the SDK.
I solved this by doing the following:
In a command prompt, type msconfig and press enter.
Click services tab.
Look for "Application Experience" and put tick mark (that is, select this to enable).
Click OK. And restart if necessary.
Thus the problem will go forever. Do build randomly and debug your C++ projects without any disturbance.
For those of you looking for a solution for this problem with the OpenGL SuperBible 6th source code samples, the solution is building in Release instead of Debug. All projects have disabled the incremental linking option in the Release version.
My problem was that I've had two paths on my PC that contained the same libraries. Both paths were added to the Additional Library Directories in Configuration Properties -> Linker -> General. Removing one of the paths solved the problem.
I had the same problem after updating of .NET:
I uninstalled the .NET framework first,
downloaded visual studio from visualstudio.com and selected "repair".
NET framework were installed automatically with visual studio -> and now it works fine!
I tried a few times and finally solved the problem by uninstalling several times the VS2010. I think I hadn't uninstalled all the files and that's why it didn't work for the first time.
In the installation of VS2012, it is said that if you have VS2010 SP1 you can't work on the same project in both programs. It is recommended to have only one program.
Thanks!

Getting "Cannot open include file: 'atlbase.h': No such file or directory" error

I am swapping machines (between two Windows 8.1 laptops) and have just loaded the project I'm working on from TFS. On one machine it compiles, on the other it does not and gives the first error
error C1083: Cannot open include file: 'atlbase.h': No such file or directory
On both laptops I am running Visual Studio Ultimate 2013. On the first laptop I've checked to see where it is picking up atlbase.h and it is from C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include i.e. from the Visual Studio 2012 installation directory. On the new machine I do not have Visual Studio 2012 installed so the directory C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include does not exist.
Other people have similar problems (e.g. Ramilol's question) because they are using Visual Studio Express. I am using Ultimate.
It could be an environment variables problem (as suggested by raj raj) but my include directory paths under VC++ Directories are $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath) as required.
My general question is "how do I fix this?" but I'd also be interested to know how I check and set the value of $(VCInstallDir) since C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include does have atlbase.h in (so I am flummoxed as to why it is not picked up).
========== EDIT 1: Rewording ==========
Let me have another go at wording this question.
I have loaded a Visual Studio 2013 project onto a new build laptop from TFS. It will not build and gives errors like error C1083: Cannot open include file: 'atlbase.h': No such file or directory. The file atlbase.h is present on the new machine, in the directory C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include.
In my project's properties my include directory paths under VC++ Directories are $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath)
How do I check what those macros are set to, and if they are not where atlbase.h is (i.e. C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include) how do I fix that?
========== EDIT 2: Microsoft Visual C++ Redistributables installed ==========
Responding to jp2code's answer the machine that works and the one that does not have a similar array of Microsoft Visual C++ Redistributables installed as the following screenshot shows (the working machine's on the left):
========== EDIT 3: Environment variables ==========
In his answer, pje explains how to look up the environment variables. %VCInstallDir% is correctly set to C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ But if I right click on the line #include <atlbase.h> I get this error which suggests that despite %VCInstallDir% being correct, that is not where VS is looking:
========== EDIT 4: Platform toolkit setting ==========
Another possibility is the Configuration Properties | General | Platform Toolset project setting, suggested by manuell in the comments and Michael Burr in his answer. For the project it is set to set to Visual Studio 2012 (v110) but the only other option listed in the drop-down is v110_wp80, which, when selected, becomes Windows Phone 8.0 (v110). If I hand edit the .vcxproj file in notepad and reopening the project in Visual Studio Ultimate 2013 the property page now lists the Platform Toolset as Visual Studio 2013 (v120) (not installed).
If I start a new C++ Windows Store project I can set Platform Toolset to Visual Studio 2013 (v120) without issue, in fact it is the only option listed in the drop-down. (N.B. The new project has Target Platform Version set to 'Windows 8.1', and it is greyed out, so I cannot change it, while the failing project has it set to Windows 8.)
========== EDIT 5: Entire project settings file ==========
In the comments Michael suggests that "maybe posting the .vcxproj somewhere (like as a gist on github) might be helpful". I have posted it here.
========== EDIT 6: Uninstalling and reinstalling Visual Studio 2013 Ultimate ==========
Has no effect, the same error recurs.
On the new machine I do not have Visual Studio 2012 installed
Well, look no further, that's your problem. Your project targets the VS2012 toolset to build a Store project that runs on Windows 8.0. You can still open it in VS2013 but it can only be built if you have VS2012 installed as well. In other words, you must have the v110 toolset available on the machine. You don't.
Short from installing VS2012, you will have to re-target to 8.1 to get it to build with the VS2013 toolset (v120). Right-click the Solution node in the Solution Explorer window and select "Retarget Windows Store projects to Windows 8.1".
Do fret a bit about that laptop, it remembers too much about VS2012. Sounds like it had it once installed but it wasn't uninstalled properly.
If you want to see the value of $(VCInstallDir) or any other Visual Studio macro, then open the Developer Command Prompt for VS2013 (this should have installed with your VS 2013 install). In the prompt type: echo %VCInstallDir%. This will print the current value of the $(VCInstallDir) macro. If you want to change this to a different directory, then type set VCInstallDir=<directory path>, where <directory path> is the path to your desired directory (presumably C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include in your case).
Hope this helps, cheers!
------edit-------
As a side note, it is possible that these macros were imported with the 2012 project that you were trying to load and compile with 2013. If it turns out that it was your $(VCInstallDir) macro that was wrong, then that would explain why.
Check that the "Configuration Properties | General | Platform Toolset" project setting is:
Visual Studio 2013 (v12)
and not something like "Visual Studio 2012 (v110)
Possible solution
Get Process Monitor
Filter for atlbase.h
this way you will know exactly where Visual Studio is looking for atlbase.h. Process monitor will show you the failed file-open attempts.
At this point you will be able to solve the problem by
make symbolic links (messy)
fix the include directory paths (better)
Update
Here is how you filter for file operations:
Don't forget to click Add after setting the filter parameters.
Check to see that both machines have the same versions of C++ Redistributable installed.
It is worth a shot, and will be easy to check.

Fresh installation of VS 2012 will not build default console application: Missing SDKDDKVer.h (and stdio.h / CRT)

I have been using the trial version of VS 2012 Professional for about 1 month on my Windows 7 64-bit machine.
Today, I noticed that the Platform Toolset option (project properties) was set for Visual Studio 2010 (v100), which seemed odd, because I am running VS 2012. Changing the "Platform Toolset" to VS 2012 resulted in the error noted in the title of this question:
Cannot open include file: 'SDKDDKVer.h': No such file or directory
... while building stdafx.cpp (the error itself occurs in the file targetver.h).
A forum discussion I was browsing earlier hinted that the presence of VS 2010 during a VS 2012 install might have caused the problem. (I do not have links to those posts currently on hand.)
Because I have recently purchased VS 2012 Professional, I uninstalled the trial version of VS 2012, and then reinstalled a paid version VS 2012 (Professional) from a fresh download from the MSDN website. All told, the uninstall/reinstall required 2 hours or so.
During the reinstallation of VS 2012, I paid very close attention to all possible options, to see if any option might conceivably have caused the VS 2012 installer to "skip" the VS 2012 header files or other VS 2012 components, and use VS 2010 components instead. I could find no such option.
Reinstallation of VS 2012 was successful.
I created a new console project in a new workspace (note that my "recent projects list" still showed my recent VS 2012 projects, despite the uninstall/reinstall). The project settings for the new console project showed that the correct toolset was being used - Platform Toolset = Visual Studio 2012 (v110).
Unfortunately, building the out-of-the-box VS 2012 console application (including the precompiled header option, but no other option in the Create Project Wizard), results in exactly the same error:
Cannot open include file: 'SDKDDKVer.h': No such file or directory
What should I do?
.
ADDENDUM: Note for future readers; after changing path settings (see comments beneath answer, below) so that VS 2012 finds SDKDDKVer.h, it nonetheless fails to find stdio.h, a more serious problem because the VC11 version of stdio.h (as well as all the VC11 CRT headers) is not available on the machine anywhere.
Unfortunately, Microsoft has still not resolved these major bugs in their VS 2012 installation process. The only way I found to get a working VS 2012 installation including all VC11 CRT files is to:
Wipe your system completely clean of all MS products (this may be overkill, but I had to at least uninstall VS 2010 in addition to uninstalling VS 2012)
Remove the registry keys noted in the comments to the answer below (to be safe)
Delete residual directories (to be safe)
Restart (to be safe)
Install VS 2012 from scratch FROM THE .ISO, not the installer (assuming the installation files are downloaded from the MSDN site) (use a program like Power2Go to mount the .iso)
THEN, be absolutely sure to install VS 2012 Service Pack 1 (through "Windows Update" control panel) (without doing this step, the VC11 CRT headers are STILL not installed anywhere on the machine)
And finally, map the Windows SDK library directories as described in [this link](Link now points to a scam site, removed) (without doing this latter step, the linker fails to finde the path to the Windows kernel library)
... THEN there is a working installation of VS 2012.
Thanks alot, Microsoft.
After I set up Visual Studio 2013, I had same sdk error for a simple C++ code. I solve same problem with below steps:
Select Project Properties>Configuration>VC++ Directories>Include Directories and add that: c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include
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:
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.
from MSDN forum:
Looking at the Include Directories for this project, I see the following
$(WindowsSdkDir)include
"WindowsSdkDir" is defined to be "C:\Program Files (x86)\Windows Kits\8.0\"
Unfortunately, the folder
"C:\Program Files (x86)\Windows Kits\8.0\Include\" doesn't actually
have any header files in it. Instead it contains three sub-folders.
One of these is the folder called "shared" which happens to contain
the "SDKDDKVer.h" file shown in the error message.
If this is your situation, replace $(WindowsSdkDir)include by the three folder names (at least $(WindowsSdkDir)include\shared) in your include path in your project properties under VC++ Directories.
To add this path permanently to VS2012, you'll need to make changes to the Microsoft.Cpp.Win32.user.props file under the C:\Users\xxx\AppData\Local\Microsoft\MSBuild\v4.0 folder (where xxx is your user name).
I had this problem with VS2013. Turns out when I separately installed Windows SDK 8.1 first, then Visual Studio 2013, it fixed the problem.
I should also note that I was installing this on a Windows 7 w SP 1 VM and at no point during the installation did it have a connection to the internet (I have read elsewhere some folks think an internet connection during install will fix the problem, but I was personally unable to verify that, and now that I have it working I'm not going to backtrack and test it).

I can't include <iostream> in Visual C++ 2010 Express Edition

Few months ago I installed Visual Studio 2012 Ultimate.
Beacuse of some school projects, I had to install Visual C++ 2010 Express Edition.
Now, when I try to compile a project in Visual C++ 2010, I cannot include any usual header
like <iostream>, <cmath>, etc. The folder the compiler searches is C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include.
But all these include files are located in C:\Program Files\Microsoft Visual Studio 11.0\VC\include.
Can someone please explain me what is about with these two paths (what are the differences)
and how to solve the #include <iostream> problem.
From the details you share, I understand that /Microsoft Visual Studio 10.0/VC/include directory doesn't contain the standard header files.
The include directory $(VCInstallDir) in VS 2010 is probably pointing at /Microsoft Visual Studio 10.0/VC. Since, the include folder is empty you don't get to compile your code.
As far as I know, this problem occurs when people install VS2012 and 2010 afterwards. My guess some problem occurs with registries and VS2010 Setup doesn't install header files properly.
You might have 4 options:
Using Visual Studio Tools->Visual Studio Command Prompt, change the $(VCInstallDir) such that it points to "/Visual Studio 11.0/include"
If you know someone who has VS2010(same edition as yours) working properly, copy their "/VC/include" directory to yours.
Uninstall both VS2012 and VS2010 ( full uninstall as described here: http://archive.msdn.microsoft.com/vs2010uninstall) Clean the registries and install VS2010 again.
Make a fresh Windows installation and install VS2010 afterwards.
Sadly only option 4 worked in my case. Option 2 worked too, but I got other problems in another project. Good luck.
I got the same problem. A fresh Windows and VC++ 2010 Express install on a virtual machine solved the problem.