30

I installed Visual Studio 2010 Premium on my Windows 7 workstation. After loading a test C++ project, I noticed that it could not locate iostream. I took a look in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include and noticed that only two files exist here, srv.h and wmiatlprov.h

I installed the VS2010 product on a test virtual machine, and this directory (...\VC\include) is filled with the usual collection of folders and headers (the materials you'd expect to find in the includes directory.)

I have taken the following steps to rectify the missing headers on the problem workstation:

  • Verified that I have no A/V software active (I am using MS Security Essentials, realtime is disabled)
  • Uninstalled Visual Studio 2010 Premium and all other sub-products from Programs & Features
  • Ran the VS2010 Uninstall Tool with the /full and /netfx parameters
  • Deleted the Visual Studio 10.0 directories from both Program Files and Program Files (x86)
  • Reinstalled Visual Studio 2010 from a freshly downloaded ISO from MSDN.

I also completed the above steps, but used a different edition for the reinstall, VS2010 Professional.

So far, nothing above has been able to produce an installed Visual Studio 2010 product with all of the C++ headers installed on my workstation.

Ideas?

Danra
  • 9,546
  • 5
  • 59
  • 117
Bear Golightly
  • 301
  • 1
  • 3
  • 3
  • 1
    My experience today is more or less the same. I had VS2010 Premium installed, but didn't use it much, and for some reason the bundled SDK in it was broken. I uninstalled it, trying hard to get all removed, and then installed VS2010 Professional. (And applied Windows Upodates, SP1, Updates again.) Now the SDK seems OK, but no C library headers... – tml Nov 30 '12 at 13:48
  • See https://stackoverflow.com/a/12584955/101252 for the VS2010_Uninstall-RTM.ENU.exe utility. Then re-install. This was effective in my case. – Jim Fred Dec 20 '17 at 13:18

6 Answers6

24

The solution to this problem is as follows. It is based on the solution given in

http://connect.microsoft.com/VisualStudio/feedback/details/774158/re-installed-visual-studio-2010-and-c-standard-headers-are-missing

  • Uninstall Visual Studio 2010.
  • Uninstall Visual Studio 2010 SP1 (despite the warning it gives).
  • Open Registry Editor (regedit).
  • Search for keys named PaddedVersion
  • Remove any parent keys VisualStudio\10.0\VC\Libraries, or similar (note the version number 10.0, which corresponds to 2010). Delete all of these registry paths. The search for the PaddedVersion key is just to ease up this search.
  • Install Visual Studio 2010.
  • Install Visual Studio 2010 SP1.

This solution may not be minimal, but it works for me. Hopefully others can confirm. The important difference here is that it is not just the HKEY_LOCAL_MACHINE from which the registry path must be deleted, as indicated in the link above.

Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
kaba
  • 703
  • 6
  • 17
3

While doing some research on this topic it seems like no matter how you uninstall Visual Studio there are always pieces left behind.

Two options to consider.

Option 1 Install VS 2010 on virtual machine. Zip needed files from your virtual machine. Copy and unzip them over to the workstation.

Option 2 Format hard drive. Install fresh copy of Windows 7. Install fresh copy VS 2010.

pb2q
  • 58,613
  • 19
  • 146
  • 147
g5insider
  • 109
  • 9
1

The Visual Studio installer is a fickle beast, to put it mildly. The generic diagnostic is that your registry is dirty, having a record of a sub-component of VS installed while it is not actually present anymore. There are a lot of sub-components and an enormous number of registry entries that keep track of their install state and their config. Finding such a dirty key back is a serious needle-in-a-haystack problem.

This kind of registry damage is very common if you ever had a beta or RC edition installed. I never had a beta version that didn't give me an enormous problem getting the RTM version installed. The VS2010 beta went particularly badly for me, albeit that I shot my foot badly by updating to Windows7 without uninstalling the beta. A gigantic mess, to put it mildly. You can expect similar kind of upheaval of you ever had an un/install that didn't complete. And of course registry damage is always around to turn this into misery.

The problem is quite common, there are Visual Studio cleanup tools around that aim to purge the registry after something like this happened. For VS2010 there are actually several. Google "vs2010 uninstall utility" to find them. No idea if they are different someway, no reason I can think of to not just run them all.

Chips are seriously down when that still doesn't fix the problem. Only thing left is to dig through the dd*.txt files that are left in the TEMP directory after an install. They contain a detailed trace of the installer's decisions. Beware that you'll drown in the amount of data.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Thanks! I also suspect a dirty registry. The uninstall utility doesn't work, unfortunately, as OP already wrote. I'm looking for someone who is willing to dive into this and see what exactly is wrong (possibly in the registry), so that everyone having this issue area able to fix it. Steps to reproduce for me were to install VS2010 pro with SP1, uninstall it, and install VS2010 premium. – Danra Jan 16 '13 at 16:58
  • You are going to have to do this "diving" by yourself, nobody has the exact same registry mess as you do, if any. If you don't want to tackle this then contact Microsoft Support for help. They'll walk you through it from their prior support case record. Being on the phone is important, so they can recommend alternate steps quickly, this just can't work through a web site. – Hans Passant Jan 16 '13 at 17:10
  • Hans, I really appreciate your help, but your comment just isn't constructive. I've already mentioned a lot of people have this issue, and described steps to reproduce. Since many people have reported the same issue, it's likely many people DO have the same registry mess. It's quite assertive to say that I would have to either dive myself or ask Microsoft, and that absolutely no-one here on SO can assist. I set a bounty because I'm curious if someone can. – Danra Jan 16 '13 at 23:55
  • Hmya, I asserted that being on the phone with an expert is required when all the normal workarounds don't produce results. I don't see a lot of other SO users dive in to help you, in spite of the bounty and a question that's been around for 4 months already. SO isn't supposed to be a personal help forum anyway, nor is it a substitute for the kind of help you can get from the product vendor. We can only hope to solve some of the problems out there on a site like this. Hopefully this answer does, for some users. – Hans Passant Jan 21 '13 at 19:45
1

I tried several rounds of uninstalling and reinstalling. The hack that finally worked was to copy the entire contents of the VC folder from a machine with a working VS 2010 installation. You probably don't need to copy all of these , but I was missing 3000+ files in include, lib, and other folders within VC.

user327301
  • 2,641
  • 2
  • 26
  • 33
  • Yeah. I did the same thing and hope everything will work well. This issue is terrible! Reformating was not a serious option. I tried to look in the %TEMP% log files, but I wasn't able to figure out what the problem was. If it can be of any help, I also have VS2008 and VS2012 installed on the same box. I also have some Windows SDKs arounds. Maybe it's related. – Simon Mourier Apr 04 '13 at 15:31
  • Could somebody give a link to such files? – Sohaib Nov 05 '13 at 22:12
0

I ran into this problem on Windows 8.1 when the VS 2010 Web installer failed to install correctly the first time. I followed Kaba's steps above with a slight difference and it solved the problem for me (so kudos to Kaba). The difference is that I deleted all the “VisualStudio\10.0” keys and all its sub-keys, as well as the “VisualStudio\10.0_Config” and sub-keys.

tstodd
  • 1
0

The solution at http://connect.microsoft.com/VisualStudio/feedback/details/774158/re-installed-visual-studio-2010-and-c-standard-headers-are-missing not worked for me.

After Uninstall Visual Studio 2010 and SP1, I used a registry cleaner software CCleaner and installed again. It fixed.

twister
  • 320
  • 4
  • 9