Compiling error: NAFXCWD.LIB (AFXMEM.Obj): Error LNK2005: "VOID __CDECL Operator Delete (void *)" (?? 3 @ Yaxpax @ z) already definedin libcmtd.lib (dbgnew.obj) Problem Description: http: / /support.microsoft.com/default.aspx?scid=kb;n-us; Q148652MSDN is related to the detailed description of the LNK2005. However, the general crux is to use the CRT and MFC runners, and CRT is linked before the MFC running library.
Problem: Cancel the pre-compiled head file and use CRTs that may result in this problem. For example, in the custom header file Common.h, the global function used is adopted, and the CRT library function is used. In this case, the MFC running library cannot be linked first in CRT. Process method: 1, if necessary Cancel the precompiled header file, you can add #include "stdafx.h" in a program module that may be compiled first. 2, do not cancel the precompiled head file. If it is more familiar with the created file module, it does not generate errors such as "Unexpected End Of File While Looking For Precompiler ...". This error is mainly unfamiliar with the organization of the project document, a simple processing method, puts public use module header files in "stdafx.h". Although in this case, change some header files may cause the entire project to be recompiled, extend the compilation time. However, if the interface is properly designed and the first use of header files, it will only make your work efficiency higher.