Already defined in libcmtd. Lib (New. OBJ) nafxcwd. Lib

Source: Internet
Author: User

Recently, I have encountered a very annoying error in VC 6.0 programming. The following error occurs: linking... nafxcwd. Lib (afxmem. OBJ): Error lnk2005: "Void * _ cdecl operator new (unsigned INT )"(?? 2 @ yapaxi @ Z) already defined in libcmtd. Lib (New. OBJ) nafxcwd. Lib (afxmem. OBJ ):

Error lnk2005: "Void _ cdecl operator Delete (void *)"(?? 3 @ yaxpax @ Z) already defined in libcmtd. Lib (dbgdel. OBJ) debug/dcap.exe:

Fatal error lnk1169: one or more multiply defined symbols found

This error is obviously because two libraries linked to provide a function with the same name. However, ignore cannot directly drop libcmtd. Lib because it is a C library. This problem occurs because the library of MFC conflicts with the library of C, and the link sequence must be set, that is, nafxcwd. lib and libcmtd. Lib. But both of them are default libraries, so how do you set their order? I found a solution that is actually tricky: first ignore them, and then add them.

Method:

Project-> settings in the displayed dialog box, select the link tab, select the input option from the drop-down menu of The Link tab, and enter: nafxcwd in the ignore libraries field on the Link tab. lib libcmtd. lib, and then enter: nafxcwd in the object/library modules of the Same tab. lib libcmtd. lib. Click the OK button, and then the order of adding them becomes the order we forced to set.


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.