The project is non-MFC, but to use the MFC library, the use of problems encountered during the summary of
Uafxcwd.lib (afxmem.obj): Error LNK2005: "void * __cdecl operator new (unsigned int)" ([email protected]@z) already defined In LIBCMTD.lib (new.obj)
Uafxcwd.lib (afxmem.obj): Error LNK2005: "Void __cdecl operator delete (void *)" ([email protected]@z) already defined in L IBCMTD.lib (Dbgdel.obj)
Uafxcwd.lib (afxmem.obj): Error LNK2005: "Void __cdecl operator delete[] (void *)" ([email protected]@z) already defined in LIBCMTD.lib (Delete2.obj)
Reason:
The CRT library uses weak external links to the new, delete, and DllMain functions. The MFC library also contains the new, delete, and DllMain functions. These functions require that you link the MFC library before you link the CRT library.
The following LNK2005 errors may occur when the link order of the C run-time (CRT) library and the Microsoft Foundation Class (MFC) library is incorrect.
Workaround:
Force the linker to link the library in the correct order!
Item, properties, Linker-Type: Additional dependencies add Uafxcwd.lib
Problem Solving!
Note: The Uafxcwd.lib library is a Debug version and the release version is Uafxcw.lib
Reprint: Http://blog.sina.com.cn/s/blog_6f50984a0100y9br.html (this solves the project problem)
Reprint: http://blog.csdn.net/chenyujing1234/article/details/8003413
These two articles are referenced by the settings, according to their own projects to verify
Note: "Error lnk2026:module unsafe for SAFESEH image" will also appear when release.
The solution is:
Reprint: http://blog.sina.com.cn/s/blog_493667730100ywt9.html
Uafxcwd.lib (afxmem.obj): Error LNK2005 Workaround