From: http://www.cppblog.com/silekey/articles/87108.html
Note: Many compilation and link parameters are added to the Framework generated by default by MFC. If we want to customize our own framework, unfamiliar compilation parameters will cause many problems.
Keyword: VC Empty Project custom pre-compilation header. PCHThe pre-compiled header file cannot be opened: "Debug/Xxx. PCH ": no such file or directory
Here is a concept to be explained first:
1> at least one CPP in the code is used to create the pre-editing Authorization header.
2> Other CPP statements are precompiled with the precompiled header.
3> the pre-compilation header is a technology that prevents repeated compilation to speed up compilation.
4> most people (in fact, I am the only one, and others have never asked) have encountered this problem because they do not know every one. CPP files can and must be set with precompiled header parameters respectively !!!!
Okay. Let's just say nothing. Create a blank project first.
Add the CPP file and write it to main;
Add config. cpp and config. h for our pre-compilation header, and set in the project:
Note: The compilation is based on. cpp. Therefore, the precompiled header file must be dependent on a. cpp file before it can be compiled.
Then we compile and get the following two errors:
Fatal error c1010: unexpected end of the file when searching for the pre-compiled header.
Fatal error c1083: Unable to open the pre-compiled header file: "Debug \ tmain. PCH": no such file or directory
Translate the corresponding errors as follows:
Fatal error c1010: Boss, you said this. cpp file needs to be precompiled with the header. If it is not found, it will strike!
Fatal error c1083: Pre-compiled headers are all used. Which of the following statements creates the pre-compiled CPP file!
Sorry, I cannot change it for you.
The first error is that config. H is not added to the. cpp file.
The second error is that the CPP file without the pre-compilation header is not created, and the compiler cannot. The solution is to set the file:
Actually, I understand that this is super simple, but I am so bored before I know it. I don't know how long it took for me to solve this small problem. previously, it was set to not use this header. later I found this thing really good!