LNK2005 error

    Question by:
    On

    Topics:

    Another link error:

    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\foo.exe : fatal error LNK1169: one or more multiply defined symbols found

    So LIBCMTD.lib is a standard C runtime library, multithreaded and Nafxcwd.lib is afx, debug version

    I have the /MTd option in Project Setting -> C/C++

    Suggested solutions to this problem that I've seen elsewhere on the net involve changing options on the Project Settings "Link" tab, which I have do not have

    Using VC++6

     

    Verified Answer?

    The member who asked this question verified this comment provided the solution that solved their problem.

    by:Posted on 2001-12-24 at 12:43:25ID: 6693108

    You need to change the order in which the libraries are linked.  Try this:
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q148652

    This content is available to Experts Exchange members

    See the answer now
    with your Free 30 Day Trial

    Get unlimited access to solutions & experts

    • 4,169,477 solved questions
    • 3,805 articles & videos
    • 15,413 tech experts

    Get Access Now

    Ask Your Tech Question. Get Expert Solutions.We will email you when an expert has commented on your question.

    We will never share this with anyone. Privacy Policy Terms of Use

    Select topics

    You may select up to five topics.

    Top Expert Contributor

    Essential articles and videos from the Experts

    More valuable questions with Expert answers

    201507-LO-Qu-065