0

I have the following C file.

#include <stdio.h>

I open an instance of Developer Command Prompt for VS 2017 and type the command.

cl [my-file.c]

I get the following error message

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

I am unsure how to resolve this problem.

Govind Parmar
  • 20,656
  • 7
  • 53
  • 85
Dan Grahn
  • 9,044
  • 4
  • 37
  • 74

1 Answers1

3

The include directories for the current session are stored in the INCLUDE environment variable.

You can view this by typing echo %INCLUDE% on the command prompt.

To add a directory to the include path, use the command set INCLUDE=%INCLUDE%;C:\foo\bar.

The fact, however, that the compiler isn't finding a standard and ubiquitous header like <stdio.h> indicates a serious problem with your Visual Studio installation. I would run a repair install if I were you.

Govind Parmar
  • 20,656
  • 7
  • 53
  • 85