LNK2005 error

    Question by:


    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

    Good Question?

    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:

    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


    RELATED TOPICS view all topics

    1. .NET Programming
    2. Visual Basic Classic
    3. Visual Basic.NET
    4. MS Access
    5. MS Applications
    6. ASP.NET
    7. MS SQL Server
    8. C#
    9. C++
    10. Editors IDEs