Nafxcwd.lib (afxmem.obj): Error LNK2005: "void * __cdecl operator new (unsigned int)" ([email protected]@z) already in LI Defined in BCMTD.lib (new.obj)
Nafxcwd.lib (afxmem.obj): Error LNK2005: "Void __cdecl operator delete (void *)" ([email protected]@z) already in LIBCMTD . lib (dbgdel.obj) defined in
Nafxcwd.lib (afxmem.obj): Error LNK2005: "void * __cdecl operator new[] (unsigned int)" ([email protected]@z) already in Defined in LIBCMTD.lib (new2.obj)
Nafxcwd.lib (afxmem.obj): Error LNK2005: "Void __cdecl operator delete[] (void *)" ([email protected]@z) already in libcm Defined in TD.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.
Workaround:
One way is to force the linker to link the library in the correct order. The second method is for you to find the module that is causing the problem yourself and correct it.
1,
Project--Properties---connector---input
Additional dependency spaces Nafxcwd.lib Libcmtd.lib
Ignores the specified library space Nafxcwd.lib Libcmtd.lib
2, Project--Properties---connector---command line input:/force:multiple
Refer to the online MSDN:HTTP://SUPPORT.MICROSOFT.COM/KB/148652/ZH-CN
LNK2005 Connection Error Resolution