fatal error C1010: unexpected end of file while…

After chopping hands, the fraud call came before the express delivery was received. How to improve the privacy and security of e-commerce>>>

When compiling VC + + 6.0, a fatal error C1010: unexpected end of file while looking for precompiled header directive
appears

Solution:

1. If the error file is caused by adding other C code files into the current project, then Alt + F7 enter the settings of the current project, select the C/C + + tab, select precompiled headers from the category combo box, and select not using precompiled headers. Sure

2. Add:
?Include “StdAfx. H” at the beginning of the file

The description of precompiled header files is as follows:

precompilation of header files is to precompile some MFC standard header files (such as windows. H and afxwin. H) used in a project. When the project compiles later, it will not compile these header files, but only use the precompiled results. This can speed up compilation and save time

the precompiled header file is generated by compiling stdafx.cpp and named after the project name. Since the suffix of precompiled header file is “PCH”, the compilation result file is projectname.pch

the compiler uses the precompiled header file through a header file StdAfx. H. The header file name StdAfx. H can be specified in the compilation settings of the project. The compiler thinks that all the code before the instruction # include “StdAfx. H” is precompiled. It skips the # include “StdAfx. H” instruction and uses ProjectName. PCH to compile all the code after the instruction

therefore, the first statement of all CPP implementation files is: “include” StdAfx. H “

Similar Posts: