Issue: Error LNK2005: "void * __cdecl operator new (unsigned int)" (?? 2@YAPAXI@Z) is already defined in LIBCMT.lib (new.obj).
Reference: http://zhanyonhu.blog.163.com/blog/static/16186044201023094754832/
1>uafxcw.lib (afxmem.obj): Error LNK2005: "void * __cdecl operator new (unsigned int)" (?? 2@YAPAXI@Z) already defined in LIBCMT.lib (new.obj)
1>uafxcw.lib (afxmem.obj): Error LNK2005: "Void __cdecl operator delete (void *)" (?? 3@YAXPAX@Z) already defined in LIBCMT.lib (delete.obj)
1>uafxcw.lib (afxmem.obj): Error LNK2005: "void * __cdecl operator new[] (unsigned int)" (?? _U@YAPAXI@Z) already defined in LIBCMT.lib (new2.obj)
1>, .... /bin/tllogger_unicode_release.exe:fatal Error LNK1169: Find one or more multi-definition symbols
Workaround:
Http://blog.vckbase.com/zaboli/archive/2010/02/05/40921.aspx
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:
Forces the linker to link the library in the correct order.
Project->properties->linker->ignore specific Library add Uafxcwd.lib Libcmtd.lib
Add Uafxcwd.lib Libcmtd.lib in additional dependencied
My Workaround: Project Properties--configuration--General--MFC use: "Static" or "dynamic" link MFC. And then compile, you can do it.