The initial error when compiling the C file on the VS2010 command line

I have VS 2010 installed on my system and I tried to compile a simple hello.c on the VS command line. Compilation gave an error.

Fatal Error C1083: Cannot open include file: 'stdio.h' no such file, folder exist

Why is this error occurring? Does VS2010 contain reference files / assemblies for C.

+6
source share
4 answers

VS 2010 certainly contains standard headers. You must ensure that the command line environment is configured correctly. There should be an environment variable named INCLUDE that has a directory similar to the ctrllowing directory (among other directories):

 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE 

this directory (the name may differ slightly, for example, depending on whether your computer is 64-bit OS not) should include stdio.h

If you do not have such a directory in your environment, you will not configure the environment correctly. You should use the "Visual Studio Command Prompt" shortcuts that install VS, or just run

 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat 

With the appropriate parameter to get the required environment ( x86 or amd64 for example).

If the INCLUDE environment variable has such an entry, but the stdio.h file does not exist, you may need to reinstall VS.

+11
source

I had a similar problem since the VC folder was missing most of the files. I tried both repair and removal / reinstallation of VS 2010, but it did not work.

What worked for me was installing the Microsoft Visual C ++ 2010 Redistributable Package (x86). Microsoft Visual C ++ 2010 Redistributable Package (x86)

+2
source

There are so many versions of Windows system code that the path becomes invalid.

In my case:

 C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include 

and

 C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib 

must be changed to:

 C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include 

and

 C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib 

i.e. v7.1A -> v7.0A (don't ask why, it's just part of the daily, tedious task of dealing with Microsoft!).

0
source

I had the same problem. The file stdio.h does not exist in the include folder. I uninstalled VS 2010 using the control panel, then reinstalled, but this did not solve the problem.

Then I used the VS 2010 installation CD to uninstall all of VS 2010, and manually uninstalled everything that was left of the Control Panel. Then I installed VS 2010 Professional again. The problem is resolved.

0
source

Source: https://habr.com/ru/post/895979/