CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Linker Error

  1. #1
    Join Date
    Sep 1999
    Location
    South Korea
    Posts
    4

    Linker Error

    Hello.
    My code has a linker error.
    I would like to fix this.
    How can I correct this? ^L^;

    nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)
    Debug/putretest.exe : fatal error LNK1169: one or more multiply defined symbols found




  2. #2
    Join Date
    Sep 1999
    Posts
    17

    Re: Linker Error

    The crt libraries and the MFC libraries both contain delete functions. When linking, the MFC libraries have to be linked first.

    Go to your project settings. Select the project configuration in the combo to the upper right (in this case the debug configuration). Select the Link tab. Select input from the category combo.

    // For debug configurations

    //In the Ingore Libraries edit box, type in:
    Nafxcwd.lib Libcmtd.lib

    //In the Object/Libraries modules edit box, type in (make sure these are the first ones listed):
    Nafxcwd.lib Libcmtd.lib

    // For release configurations, remove the 'd' chararters before .lib. (ie libcmtd.lib is for debug builds and libcmt.lib is for release builds)


  3. #3
    Join Date
    Sep 1999
    Location
    South Korea
    Posts
    4

    Re: Linker Error

    Thanks to your assistance I succeeded in the attempt.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured