Original address: http://blog.sina.com.cn/s/blog_8216ada701017evx.html
In VS2010 under VC + + debugging, there is a mistake: Error C2065: Undeclared identifier, then feel very strange, why say weird? Because it is normal to have such an error if the associated. h file is not introduced in the. CPP, but now that the relevant header file has been introduced, there are still errors such as Error C2065, error C2087, error C2133 ... The error.
In this case, a new project was created that wanted to use the same set of. cpp/.h files as defined in other projects, but the code in the full copy file was prompted in the new project, but there was no error in the original project, and the same machine was in error. At that time, the idea is that the properties of the two projects are different, so that the properties of the new project to change the original project properties, but there are still such errors, in the online search for this information, most of the introduction is not the introduction of the relevant header file, after all, the error is: undeclared identifier, But that changed to not solve the problem.
The final solution is to modify the order of the header files, the original copy "#include" StdAfx.h "" in the last position of several header files, advance it to the front position, the problem is resolved. The original is not only to introduce the relevant header file, its position should be put correctly . Of course, the precompiled header file should be placed in the first place, but in the original project in the last but no mistakes, strange.
Error C2065: An undeclared identifier is wrong