Click to See Complete Forum and Search --> : Linker Error


knpark
September 27th, 1999, 08:59 PM
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

shanep
September 27th, 1999, 09:30 PM
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)

knpark
September 27th, 1999, 10:04 PM
Thanks to your assistance I succeeded in the attempt.