visual studio 2010 cannot include stdlib.h - c++

I have been dealing with this problem the whole day. The problem happened after I uninstalled visual studio from control panel. I installed visual studio professional again from webinstaller. Then I started getting these error messages:
Cannot open include file: 'stdlib.h'
Cannot open include file: 'excpt.h'
Cannot open include file: 'afxwin.h'
Cannot open include file: 'math.h'
I tried to uninstall and install several times, but it didnt help, I tried to install visual studio premium, didnt help also, somehow these header files are missing from the directory where they are supposed to be. I also searched my computer these files does not exist...I tried to repair visual studio 2010 SP1...it didn't help also.
EDIT1:
I tried to create a win32 console application, and I left everything as the default:
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
And I got this compiler error:
fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory

I tried to uninstall all visual studio versions that I have, I tried to clear all VS2010 related registry ...all of that didn't work.
The only solution that works for me is to copy C:\Program Files (x86)\Microsoft Visual Studio 10.0\vc folder from one healthy computer to mine.

Related

C++ compilation error on visual studio 2008

I am using visual studio 2008 due to some compatibility issues, i am getting the following error while building my project -
fatal error C1083: Cannot open include file: 'vcruntime.h' : No such file or directory.
I even installed Windows sdk and included the path in my workstation but this error is just taking my time, oit has been almost a day now, i even tried to search this 'vcruntime.h' but its not present in my system
i would love to here some suggestions,
tried installing windows sdk and added to my projects path but not working

fatal error C1083: Cannot open include file: 'excpt.h': No such file or directory

How to solve this problem.
This problem appear when I run one of my codes which I had written.
I use visual studio 2010 ultimate to write the code
in the options dialog you can tell vs where to look for include files. Look for
Projects and solutions>VC++ Directories
file location : C:\Program Files\Microsoft Visual Studio 11.0\VC\crt\src
if you don't find, may be re-install VS2012

Visual studio 2012 can't find files inside of Include Directory

When I compile in VS2012, I get error that cant find files that should be in the #include directory, "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include".
I've attempted to resolve this by copying the #include directory from VS2010 in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
This presented more errors. I've also tried changing the path for the #include directory (in Project/Properties/VC++ directories) as suggested here with
$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(WindowsSDK_IncludePath);$(FrameworkSDKDir)\include.
I've also reinstalled VS2012 several times to no avail. Does anybody have a solution.
It could be a known bug described here: http://connect.microsoft.com/VisualStudio/feedback/details/762015/include-and-libraries-directories-not-setup-correctly-for-c-if-vs2010-already-installed
The installer has a bug if 2010 was previously installed. I experienced this one.
Microsoft supports stdint from VS 2012 on. Look here.
#include <cstdint>

Visual Studio 2010 Cannot Open VC++ Include Files

really struggling with a Visual Studio issue here. I get a bunch of errors from Visual Studio after having re-installed it, about it not being able to find VC++ libraries:
Error 1 error C1083: Cannot open include file: 'stdlib.h': No such
file or directory
Error 2 error C1083: Cannot open include file:
'sys/types.h': No such file or directory
Error 3 error C1083: Cannot open include file: 'stdio.h': No such file
or directory
Error 4 error C1083: Cannot open include file: 'stdlib.h': No such
file or directory
Error 5 error C1083: Cannot open include file:
sys/types.h': No such file or directory
Any ideas how I can resolve this issue? I just did a search for stdlib.h in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC and I didn't find anything. What will repopulate my libraries?
Its a dirty solution, but it works: Copying these files over from another computer with these files on it for this version of Visual Studio seems to have worked.
The exact error I received was:
error C1083: Cannot Open include file <stdio.h>
Since I had three versions of VS on my computer, I decided to check whether all versions had this file in their install folders. I discovered that VS 2010 (VC 10.0) did not, and yet I had opened my project in VS 2010.
I opened my project in VS 2012 (VC 11.0). VS 2012 prompted me to "update" the project from an older version of VS to a newer one. I clicked OK. The update was successful. I then compiled my project. And the error was gone.
I was curious to find out if stdio.h actually existed in the install location for VS 2012. And indeed it did at: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\stdio.h. Thus, it appears that upon installing multiple versions of VS, my stdio.h file somehow vanished from my older VS 2010 installation. Am not quite sure about this theory, though.

Troubles with errno.h

I'm coding a simple SDL program with VC10. The problem that I am having is at compiling the program:
Error 1 error C1083: Cannot open include file: 'errno.h': No such file
or directory c:\program files\microsoft visual studio
10.0\vc\include\cerrno 14
Error 2 error C1083: Cannot open include file: 'errno.h': No such file
or directory c:\program files\microsoft visual studio
10.0\vc\include\cerrno 14
Error 3 error C1083: Cannot open include file: 'errno.h': No such file
or directory c:\program files\microsoft visual studio
10.0\vc\include\cerrno 14
Error 4 error C1083: Cannot open include file: 'errno.h': No such file
or directory c:\program files\microsoft visual studio
10.0\vc\include\cerrno 14
I'm not sure what could be the problem. I don't have an errno.h file in my includes. And I have no idea of where to get it or if it was there. What can I do? I have been looking for an errno.h file around but all seem aimed at Linux platforms.
did you install the SP1 for VS2010, if yes, you can install Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1 to resolve the issue,
see http://blogs.msdn.com/b/vcblog/archive/2011/03/31/10148110.aspx
Seems like a bad installation, the file errno.h is missing. It should be somewhere in compiler includes and you need it because cerrno refers to it.
The solution for me was re-running the installer, selecting "Individual Components", and adding the older common tools (v140).
I had the same issue. retarget the windows SDK version in project configuration properties to a version installed on the system, this solved the issue for me.