You are currently offline, waiting for your internet to reconnect

FIX: C1024 or C1083 Error When INCLUDE Set to Root Directory

This article was previously published under Q97809
This article has been archived. It is offered "as is" and will no longer be updated.
An attempt to compile an application fails and Microsoft C/C++generates one of the following messages. For version 8.0:
fatal error C1083: Cannot open include file: 'stdio.h':
Permission denied
For version 7.0:
fatal error C1024: cannot open include file 'stdio.h'
The application compiles correctly in Microsoft C version 6.0 forMS-DOS.
The INCLUDE environment variable specifies the root directory of adrive and a required header file is located in the root directory.This occurs most often when the MS-DOS SUBST command creates adrive letter for a subdirectory on a drive.
To work around this problem, edit your AUTOEXEC.BAT file to replacethe backslash character (\) in the directory specification with aforward slash character (/). For example, the modified SETstatement would appear as follows:
   set INCLUDE=C:/ 				
For a drive letter created with the SUBST command, omitting thebackslash character entirely also works. For example:
   set INCLUDE=M:				
Microsoft has confirmed this to be a bug in the products listed at thebeginning of this article. This bug was corrected in C/C++ version 9.0,included with Visual C++ 32-bit Edition, version 2.0.
Perform the following two steps to demonstrate this problem.

  1. Copy STDIO.H to the root directory on your C drive.
  2. Enter the following at the MS-DOS command prompt:
       set INCLUDE=C:\    cl TEST.C							
If your C/C++ INCLUDE directory is C:\C700\INCLUDE, the error alsooccurs if you enter the following at the MS-DOS command prompt:
   subst M: C:\C700\INCLUDE   set INCLUDE=M:\    cl TEST.C					
The compiler uses the INCLUDE environment variable to specify thedirectories it searches for header files listed in the #includestatement.

The MS-DOS SUBST command can be used to substitute a drive letter fora directory path. For more information on the SUBST command, pleaserefer to your "MS-DOS User's Guide and Reference" manual. Also notethat the online help for MS-DOS version 6.0 states "Do not use theSUBST command when you are running Windows."

Sample Code

/* * Compile options needed: none */ #include <stdio.h>void main (void){   printf("Hello World\n");}				
1.00 1.50 7.00 8.00 8.00c

Article ID: 97809 - Last Review: 01/11/2015 00:49:41 - Revision: 2.1

Microsoft C/C++ Professional Development System 7.0, Microsoft Visual C++ 1.0 Professional Edition, Microsoft Visual C++ 1.5 Professional Edition, Microsoft Visual C++ 1.0 Professional Edition

  • kbnosurvey kbarchive kbbug kbcompiler kbfix KB97809