LNK2005 Connection Error Resolution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.