Dear Colleagues! I wanted to program C ++, and Visual Studio 2015 IDE behaved very cunningly. I'm trying to compile an empty project, and she to me:

 **Error C1083** Cannot open include file: 'stdio.h': No such file or directory ConsoleApplication2 c:\users\samsung\documents\visual studio 2015\consoleapplication2\consoleapplication2\stdafx.h 

If I write something in the project

 #include <conio.h> 

So IDE will generally emphasize this to me in red. Here are screenshots of disgrace: enter image description here enter image description here

Question:

What do I need to fix in the computer settings or IDE, so that everything works?

  • if I'm not mistaken, the studio setup file has the option to fix the installed environment - Matty
  • I agree with @Matty, you need: Control Panel -> Programs (program removal) -> we find Visual Studio -> Change -> Repair - Bulson
  • And you do not create an empty project, it is more difficult. Create a standard console application that should work out of the box. - VladD
  • @VladD, on the contrary, an empty project is simpler. I would clean it up completely, without any stdafx. - Qwertiy

3 answers 3

 #include <conio.h> 

This no longer exists. In general, there is nowhere except Borland C ++.

  • Sorry, not quite clear what it means does not exist ? - isnullxbh
  • Does <stdio.h> exist? - Andrew Kachalin 2:49 PM
  • @AndrewKachalin, yes, stdio.h exists. But stdafx is precompiled somehow, so if it breaks after connecting conio, then this may be the reason. - Qwertiy
  • without a horse, with one studio does not plow. So it goes i cry - Andrew Kachalin
  • Then I do not know ... - Qwertiy

From the admin run? Is the studio on the C drive installed? MB try to increase privileges for the folder where you installed VS and "C: \ Program Files (x86) \ MSBuild"?

enter image description here

  • from admin, privilege everything is there. But all = thanks. - Andrew Kachalin

All found. The reason for this is виндовс 10 , which by default does not want to work correctly with visual studio 15 . After the English-speaking Internet began to bust, I solved this problem. In more detail:

Inside *Visual studio* paths to the C headers have changed.

Information about this error can be found here: https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/

I managed to solve this lack of need: Go to Project->Properties-> . In Configuraton Properties->VC++ Diretories->Library Directories add paths to C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10150.0\ucrt\ (Here you choose your architecture)

And in C/C++->General->Additional include directories in this line add the path:

 C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt 

Note: 10.0.10150.0 may significantly depend on your operating system version.

2. After the above manipulations, you may get the error LNK1104 cannot open file 'ucrtd.lib' . (At least this error got out of me). How to solve it is well shown in this video.