Share via


Visual Studio C++ 2012, standard header files are missing.

Question

Thursday, January 3, 2013 4:20 AM

I know there are some topics regarding VS2010, but couldn't find 2012, so i'm asking here.

All the solutions for VS2010 does not work for the issue.

I have re-installed VS2012 premium. After re-installing, I tried Visual C++ hello world project.

#include <stdio.h>

couldn't be even get compiled because of missing header files.

I checked {VS installation dir}\VC\include, but there were only 2 files namely srv.h, vsgcapture.h.

I have done repair, uninstall, install several times but with no success.

What should I do to get the missing header files back?

All replies (25)

Friday, January 4, 2013 6:25 AM

Hi,

Seems it didn't install the header files when you install the Visual Studio 2012.

Please uninstall your Visual Studio and download new ISO image from:

http://www.microsoft.com/visualstudio/eng/downloads

Disable the Anti-virus software. Then install the Visual Studio 2012.

If it doesn't work, please feel free to let us know.

Best regards,

Ego [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Monday, January 7, 2013 6:10 AM

I've uninstalled and reinstalled, but with no success. It didn't help. Sorry. I also uninstalled relevant tools that shipped with VS2012 installation.


Wednesday, January 9, 2013 8:45 AM

Hi,

I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
 
Thank you for your understanding and support.

Best regards,

Ego [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Monday, January 14, 2013 9:51 PM

Hello, I believe you are running into the similar issue that has been reported to the connect bug site: Connect Bug.  Please can you confirm.  It would also be of help to see your installation log files to help us figure out what is happening. 

You can gather the logs using http://bit.ly/vscollect and then upload the results to skydrive.

Also please search your disk to see if another VC directory got created in a different folder location.  You could try searching for some of the missing header files that are missing.

thanks

Kelvin


Tuesday, May 14, 2013 9:51 PM | 13 votes

To those of you who used a search engine and arrived at this thread:

I had this problem and I have discovered an actual workaround that actually fixes this issue.  I am really quite shocked that the bug was marked as "won't fix" since this issue is something that renders a product completely unusable.  Also, "install it on another computer and copy the files over" isn't a workaround- it's a waste of time and resources and assumes that I have another computer available and can install VS onto it without the same issue.  

I believe the repro for this issue is to install VS2010 and use it (ensure it is configured for C++ development).  Then install VS2012 and select "import settings from VS2010" and then uninstall VS2012 (nuke all the files and be sure that it's completely gone) and then re-install VS2012. 

Here's an actual workaround that I have verified fixes my issue.  Your results may be slightly different (I'll indicate places where this may be the case):

1.  Install VS2012.  In the program files (x86)\Microsoft Visual Studio 11.0\VC\include directory you should notice that no standard header files are present (example: no conio.h, crtdbg.h, etc.) and if there are, then your problem is with the include paths in visual studio.

  1.  The problem component is vc_librarycore- it won't actually copy the files because for some reason it thinks that it is trying to patch the files instead and it has no patch available (specifically "file <name> has no eligible binary patch" if you install with msiexec /i vc_librarycore /l*vx logfile.txt).  We need to force it to install so first we must uninstall it.

  2.  Open regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\AD1AEE2A-D9C0-3FAC-8D6B-B5E07B47257B} and look at the "DisplayName" to ensure that this is the "Microsoft Visual C++ Core Libraries" and not something else.  If you don't have this key, then the vc_librarycore component was not installed so try re-running visual studio setup with the repair option.  Otherwise skip step 4

  3.  You need to uninstall this.  Open an administrator command prompt and type the command in the "UninstallString" key under the registry key in step 3.  On my box, this was MsiExec.exe /x{AD1AEE2A-D9C0-3FAC-8D6B-B5E07B47257B}

  4.  Now we need to manually install this.  You may have (probably have) the package locally on your machine under this directory (again, my machine): "C:\ProgramData\Package Cache\AD1AEE2A-D9C0-3FAC-8D6B-B5E07B47257B}v11.0.50727\packages\vc_librarycore" and if you don't, create it and copy over everything into it from the VS2012 CD in <cdromdrive>:\packages\vc_librarycore directory (a bunch of .cab files and a file called "vc_librarycore.msi"- copy them all).  Do not try to run vc_librarycore.msi directly from the CD because it won't work without being run by setup.exe (go ahead and try it) but that's ok, we'll deal with this in step 6

6.  The reason that vc_librarycore.msi won't run is because the msi file has a condition in it that prevents it from running outside of setup.exe.  Let's just go ahead and remove that condition then!  You'll need a Microsoft utility called "Orca" to do it (it's installer, Orca.msi, can be found in the Windows SDK or just search msdn for it).  Launch Orca and open the file vc_librarycore.msi.  Now you can see everything the MSI is doing.  Look for the key "CA_LaunchCondition_4.3643236F_FC70_11D3_A536_0090278A1BB8" and remove it from absolutely everywhere you find it.  You can use ctrl-f to simplify this task.  Once this is done, save the .msi and close Orca (if you don't close Orca, then you'll get an error in step 7)

7.  Now open an admin command prompt and navigate to the directory that contains vc_librarycore.msi that you created or found in step 5.  Type "MsiExec.exe /a vc_librarycore.msi" and it will do an administrative install of the vc_librarycore package and it won't annoy you about not being run as part of setup.exe anymore.  If it complains about being unable to open the .msi or package or whatever, it means you probably forgot to close Orca.  

8.  The command in step 7 ought to take a couple of minutes to run.  If it completes in seconds, it didn't work for some reason (be sure you used /a and not /i or /fa or anything else in step 7).  On my box, this ended up putting the necessary files in Program Files\Microsoft Visual Studio 11.0\VC\ for some reason and I never got it to go to the correct directory, so just copy the VC folder into the actual directory (probably program files (x86)\Microsoft Visual Studio 11.0\VC).  There will be only about 4 conflicts or so and they're all .lib files and the files being copied are identical to the files in the directory, so just overwrite and select "do this for all" and you should be ok.

9.  Now re-launch Visual Studio 2012 and you should be able to actually get things done with it.  I haven't tested much beyond verifying that it can find header files such as <tchar.h> and <stdio> and <iostream> but so far everything seems to work.

  1.  Since MS "won't fix" this but they broke Pix so it's impossible to debug Directx shaders without VS2012, do the only thing that you can in this type of scenario: go on the internet and complain.  Maybe someday MS will bother to test the install and uninstall scenarios on their products (they didn't for VS2010 when I was there; uninstall didn't work until like a week before the public beta) but I suspect if I held my breath that I'd pass out and bang my head on the coffee table.

Seriously, it should NOT be necessary for me to spend two weeks manually messing with your installers to get the product to work as advertised on a supported operating system.  This whole thing is just sad.

p.s. post something if this works for you!  I'm curious to know if this is effective on more computers than just mine.  I suspect that it will be.


Saturday, May 25, 2013 5:07 PM

Jeff,

After spending days on this issue, thankfully I found your post.  It worked great for me, although in step 8 in my case it put the files in: 

C:\Users\xxxx\Documents\Visual Studio 2010\Projects\Program Files\Microsoft Visual Studio 11.0

I owe you a cold one, hell I owe you a keg!


Wednesday, June 19, 2013 5:15 AM

you are a very great man. thank your solution very much.


Tuesday, June 25, 2013 11:24 PM

Jeff, thank you so much for taking the time to figure this out. Your solution worked for me. Step 7 put my files on another drive "F:\Program Files\, and created a "Microsoft SDKs" folder as well as the Microsoft Visual Studio 11.0" folder, (which you didn't mention, just in case you are missing any files). I also found I needed to do a clean and rebuild of the project I was having trouble with. Saved my ass, you did. Total cost to me for this problem, just over an hour. Sincere appreciation, Al :)


Friday, June 28, 2013 9:04 AM

That worked for me on the Express Edition, after I got the same problem. 

Interestingly, when I installed Visual Studio Update 3 afterwards, I got an "Microsoft Root Certificate Authority 2010 or 2011 is missing" warning. Maybe just a coincidence. All installed without problems.


Friday, July 12, 2013 5:09 AM | 1 vote

We need an update for Jeff's solution since Update 3 for VS2012 is released.

The package ID of vc_corelibrary for Update 3 is {2F8F489A-0476-3129-857B-A553F38B192D}.

It's different from Update 2's one. Note that this difference cause changes to the name of registry key for uninstallation and package cache folder.

Anyway, thank you for this great investigation and solution, Jeff.


Sunday, July 14, 2013 10:50 AM

Doesn't work for me. On Step 7 it says, that it couldn't open the package. Orca isn't running and i looked up the path several times. So i just switch over to VS 2013 and hope that it workes ...


Friday, July 26, 2013 7:34 AM

Thx an awful bunch for this! You saved my day!

For some reason (like for other guys here) the files ended up elsewhere, in my case in T:\Program Files where T: is my external USB3 backup drive ;-)

Merging this (both the 'Microsoft SDKs" folder as well as the "Microsoft Visual Studio 11.0" subfolders) into C:\Program Files (x86) did the trick.


Friday, August 30, 2013 11:55 AM

Unfortunately I just discovered that I also miss some files in C:\Program Files (x86)\Microsoft Visual Studio 11.0\vc\atlmfc\include.

I've tried the same trick with vc_libraryextended.msi (verified this is where e.g.  atlcore.h is found) but for some reason installing that manually does NOT copy the missing files.

Any clue?


Wednesday, February 19, 2014 8:08 PM

I have also just found my standard C includes missing in VS 2012. Another oddity is that attempting to install any of the VS 2012 updates leaves me with an unstable VS, which gets an exception any time I try to look at a call stack when debugging CLR programs. So I have uninstalled/repaired the original VS 2012 installation two or three times while backing out from the updates.

From Jeff's hint that reproducing the problem required installing VS 2012 while VS2010 was still installed, I tried removing this situation.

I uninstalled all the pieces of VS 2012 I could find.

Then did the same for VS 2010.

I also renamed all the registry entries I could find for Visual Studio 10.0 and 11.0 (I think they were in three places: HKLM\Software\Microsoft\VisualStudio, HKLM\Software\Wow6432Node\Microsoft\VisualStudio, and HKCU\Software\Microsoft\VisualStudio.

Finally I renamed all the file system entries for VS 2010 or 2012: \Program Files (x86)\Microsoft Visual Studio 10.0 and 11.0, \ProgramData\Microsoft\VisualStudio\10.0 and 11.0, \users\myself)\AppData\Local\Microsoft\VisualStudio\10.0 and 11.0, and \users\myself)\AppData\Roaming\Microsoft\VisualStudio\10.0 and 11.0.

I reinstalled VS 2012 and now I have my include files. Not only that, Update 4 installed with no errors and works! Rather than renaming all the registry and file system entries I could have deleted them as well.


Wednesday, April 30, 2014 4:24 PM

Try deleting the registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\VC\Libraries

Then repair VS 2012.


Tuesday, May 6, 2014 11:30 AM

I had the same issue after uninstalling and re-installing VS2012, not sure about the actual repro, but the error is definitely the same.

In the end I copied the files in all of:

\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib
\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include
\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc

, which were all lacking a bunch of files, from a colleagues computer. All of the repro steps in Jeff's solution worked up until step 8, where I couldn't find the missing library files anywhere on my hard drive 
The command in step 7 ought to take a couple of minutes to run.  If it completes in seconds, it didn't work for some reason

Also, sba pointed out that Jeff's fix wouldn't help if files were missing from atlmfc.

Since copying the libraries manually solved my issue, I never got around to trying Soumitra's solution, or re-doing all the steps with the {2F8F489A-0476-3129-857B-A553F38B192D} id, suggested by Synastry.

Thanks all, for your insight into this puzzling (and quite annoying) issue!


Tuesday, July 22, 2014 8:45 AM

I had the same problem after uninstalling VS2012 Professional and installing Premium.

I didn't try Jeff's solution, but after several times trying repair modify or uninstall and re-install (with reboot and all), I got another error message: 'Visual Studio 2012: "The event log file is full" error message'

I googled that and found a blog entry 'Visual Studio 2012: "The event log file is full" error message' by Mandi Anez Ohlinger [MSFT] in MSDN Blgs.

The recipe there finally worked. Unfortunately, thanks to Microsoft I cannot link it here :-(

This is what it says:

1. In Control Panel, uninstall Visual Studio 2012.

2. Delete all the files in %ProgramData%\Package Cache. To open this folder, open
the Run window, and type: %ProgramData%\Package Cache. On Windows 8, the
ProgramData folder is hidden.

3. Forcibly remove Visual Studio 2012:

 a) Open the command window as Administrator.

 b) Type:"drive:\InstallPath\vs_professional.exe" /uninstall /force

  c) Hit Enter.

4. Ran the Visual Studio setup again. Success.

In Step 4 I did the complete Install with all components although I only needed Visaul C++ and web-development. I'm not quite sure which step or wich combionation of either really solved the issue, but since I found subfolders with creation date of my earlier installation in "%ProgramData%\Package Cache" I suspect that remnants there of the previous installation caused the trouble.

 


Tuesday, August 26, 2014 2:52 PM

Jeff,

Thank you! This solution worked amazingly. Thank you for sharing! Thank you!

BTW, on my machine the header files got installed to D:\Program Files\Microsoft Visual Studio 11.0\VC\ of all places!

Cheers!


Thursday, February 12, 2015 10:02 PM

I've been banging against this for days.  You just saved me countless more - Thank you, very, very much.  :)

Microsoft: This sucks and needs fixing.


Friday, June 26, 2015 6:35 AM

Thank you, your solution helped me!

Btw, I had Core libraries with B362A397-B38A-3A23-A190-611F9C7EB4F9 number and installed vc_librarycore86.msi. May be some readers would have same situation.

And yes, that's  why some people dislike microsoft.


Wednesday, July 29, 2015 9:48 AM

I had this problem, so I can say that this is now fixed if you install update 4 (I did not try any earlier updates, when this problem was manifest)


Sunday, August 23, 2015 5:13 AM

I tried what Soumitra Mondal suggested for the same problem I have with VS2010. Does not work unfortunately.


Monday, August 24, 2015 2:10 AM

I had the same problem after uninstalling VS2012 Professional and installing Premium.

I didn't try Jeff's solution, but after several times trying repair modify or uninstall and re-install (with reboot and all), I got another error message: 'Visual Studio 2012: "The event log file is full" error message'

I googled that and found a blog entry 'Visual Studio 2012: "The event log file is full" error message' by Mandi Anez Ohlinger [MSFT] in MSDN Blgs.

The recipe there finally worked. Unfortunately, thanks to Microsoft I cannot link it here :-(

This is what it says:

1. In Control Panel, uninstall Visual Studio 2012.

2. Delete all the files in %ProgramData%\Package Cache. To open this folder, open
the Run window, and type: %ProgramData%\Package Cache. On Windows 8, the
ProgramData folder is hidden.

3. Forcibly remove Visual Studio 2012:

 a) Open the command window as Administrator.

 b) Type:"drive:\InstallPath\vs_professional.exe" /uninstall /force

  c) Hit Enter.

4. Ran the Visual Studio setup again. Success.

In Step 4 I did the complete Install with all components although I only needed Visaul C++ and web-development. I'm not quite sure which step or wich combionation of either really solved the issue, but since I found subfolders with creation date of my earlier installation in "%ProgramData%\Package Cache" I suspect that remnants there of the previous installation caused the trouble.

 

I tried this for the same problem I am having with VS2010, but had no success.

- deleting everything in %ProgramData%\Package Cache has no effect

- did not find a /uninstall /force option to "forcibly" uninstall VS2012

I could not even try the method posted by Jeff_322089BE-DFC2-11DF-B454-B541DFD72085 as the instructions do not really match up. I can't find "Microsoft Visual C++ Core Libraries" in my registry, neither do I have a vc_librarycore.msi among my setup files (which was obtained from MSDN subscriber downloads, not from a CD).

:( I think I'm left with copying the c++ library files from one of my colleagues


Saturday, September 3, 2016 1:00 AM

Thanks @Jeff_322089BE-DFC2-11DF-B454-B541DFD72085 ! Your step-by-step solution worked like a charm and VS 2012 is working now. The developer community is forever indebted to you :)


Saturday, January 27, 2018 10:27 PM

Hello Jeff,

  Many thanks for this amazing tutorial, that did work for me. I work on a Windows Server 2008 R2 that runs Visual Studio 2005, 2008, 2010 and 2012.

  As for a guy above, the files went to another drive (I: for me... the last letter with drive rights...)

I know we are in 2018, but I still need to install visual 2012 :S