If the /Yc option is used to create a precompiled header from a header file which contains a syntax error, as shown in the code below, the compiler will incorrectly generate the following error:
This error is generated after the header file syntax errors are listed and after all lines of the source file have been processed.
error C2857: '#include' statement specified with the /Yctest.h
command line option was not found in the source file
Correct the syntax errors contained in the header file.
Microsoft has confirmed this to be a bug in the Microsoft products listed above. This bug was corrected in Visual C++ version 4.1.
The following code can be used to demonstrate this problem.
/* Compile options needed: /Yctest.h /c
x int; /* This file is intentionally given an error */
/* to demonstrate the problem in the article */
ID članka: 115707 – Zadnji pregled: 5. jul. 2005 – Revizija: 1