Fatal Error C1010: Unexpected end of file encountered while looking for precompiled headers. Did you forget to add “#include” stdafx.h “to the source?
Error analysis:
this error occurs because the compiler is looking for a precompiled indicator header (default #include “stdafx.h”) when the file does not end as expected. The header file “stdafx.h” with precompiled instructions was not found.
(because the project of every CPP file attributes the default is to use the precompiled header (/ YU), but add a third party documents not # include “stdafx. H” precompiled directives, so the compiler in the CPP file until the end did not find it)
my this problem occurred in, by means of adding files to add to existing within the MFC one big tuo. H and. CPP file. These.h and.cpp files belong to the standard C++ open source code category and have no deeper relationship with MFC.
Solution: a.
1) in the solution explorer, right-click on the corresponding. CPP file, click “properties”
2) on the left side in the configuration properties, PM on “C/C + +”, click “precompiled header”
3) changes on the right side of the first line of “create/use precompiled header,” option from the “use precompiled header (/ Yu)” to “do not use the precompiled header”
4) note:
2.
(not recommended)
1) in the solution, right click on the project, click on properties
2) in the configuration properties -> c/c++ -> Changing “use the precompiled header (/YU)” to “do not apply the precompiled header”
in the precompiled header will make every compilation process very slow
Refer to the blog: http://blog.csdn.net/zrm_1995/article/details/68490749?locationNum=2& fps=1
Read More:
- Solution of header file StdAfx. H “no such file or directory” in Visual Studio
- Solution of unable to open source file “StdAfx. H” in vs2013 / 2012
- gcc /usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
- A fatal error C1083 occurred when compiling C + + code under. Net: unable to open the include file: “xuhk”_ Jnihelloworld. H “: solution to no such file or directory error.
- Fatal error c1859: unexpected precompiled header error. Simply rerun the compiler may fix this problem
- IntelliSense: unable to open source file ‘StdAfx. H’
- IntelliSense in VC + + 2010: unable to open source file “StdAfx. H”
- #During OpenGL development, fatal error C1083: can’t open include file: “GL / glut. H”: no such file or directory
- Vs fatal error C1083: unable to open include file: “sys / socket. H”: no such file
- Error in header file when calling OpenGL to open obj file in vs2013: unable to open include file: “GL / glut. H”: no such file or directories
- Linux QT download / usr / include / C + + / 7/ cstdlib:75 : 15: fatal error: stdlib. H: no such file or directory error
- Vs2017 C + + cannot open source file: “sdkddkver. H”, “stdio. H”, “TCHAR. H”
- Record the pits you stepped on – NSS error – 5938 (PR_ END_ OF_ FILE_ ERROR), curl: (35) Encountered end of file
- Compiling the pi_kernel source code appears: fatal error: openssl/opensslv.h: No such file or directory
- VS2010 compiler can’t open include file: “GL / glaux. H”: no such file or directory
- How to solve the problem of “unable to open include file:” graphics. H “: no such file or directory”
- Solution of VS2008 unable to open GL / glaux. H header file
- Vs QT project ‘fatal error C1083:’ failed to open include file
- Vs compiling OpenGL project, the solution of unable to open the source file “GL / glaux. H” appears
- Fatal error C1853 error occurs when there are mixed .c files in the VS project