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

    Good Question?
    0
     

    ?

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

    Accepted Solution 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

    Top Expert Contributor

    Essential articles and videos from the Experts

    More valuable questions with Expert answers

    201601-LO-Qu-076

    Extend your technology team with the Experts Exchange community.

    — trusted by —

    Who answers my questions?Our community has technology experts around the world.

    James0628

    1,877

    Solutions

    Expert in:

    • Crystal Reports
    • DB Reporting Tools
    • MS SQL Server
    • Databases-Other
    • MS SQL Server 2005

    mrcoffee365

    1,048

    Solutions

    Expert in:

    • JSP
    • Java
    • Web Development-Other
    • Java EE
    • Apache Web Server

    David Johnson, CD, MVP

    5

    Articles

    7,123

    Solutions

    Expert in:

    • MS Legacy OS
    • Windows 7
    • Windows Server 2008
    • .NET Programming
    • ASP.NET

    Mandeep Singh

    1

    Articles

    54

    Solutions

    Jacques Bourgeois (James Burger)

    2

    Articles

    2,049

    Solutions

    Expert in:

    • .NET Programming
    • Visual Basic.NET
    • C#
    • MS Development-Other
    • ASP.NET

    Vitor Montalvão

    11

    Articles

    2,158

    Solutions

    Expert in:

    • MS SQL Server
    • MS SQL Server 2008
    • MS SQL Server 2005
    • Query Syntax
    • Databases-Other

    DanRollins

    84

    Articles

    4,770

    Solutions

    Expert in:

    • MS Development-Other
    • System Programming
    • C++
    • Editors IDEs
    • JavaScript

    Jim Dettman (Microsoft MVP/ EE MVE)

    7

    Articles

    5,374

    Solutions

    Expert in:

    • MS Access
    • MS Applications
    • Databases-Other
    • MS Development-Other
    • MS Office

    Scott McDaniel (Microsoft Access MVP - EE MVE )

    11,136

    Solutions

    Expert in:

    • MS Access
    • Query Syntax
    • Visual Basic Classic
    • Databases-Other
    • MS Applications

    RELATED TOPICS view all topics

    1. .NET Programming
      (131,146)
    2. Visual Basic Classic
      (162,830)
    3. Visual Basic.NET
      (91,461)
    4. MS Access
      (214,084)
    5. MS Applications
      (44,167)
    6. ASP.NET
      (122,127)
    7. MS SQL Server
      (154,732)
    8. C#
      (90,429)
    9. C++
      (56,719)
    10. Editors IDEs
      (25,097)