Software and more...

Overloading global new and delete operator in C++

I wanted to overload global new and delete operator compiling my code with VC8 I was getting errors like:

error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in MSVCRTD.lib(MSVCR80D.dll)

To fix it I had to edit my project properties go to Linker -> Command line -> Additional options and add:

/NODEFAULTLIB:"msvcr80.lib" /NODEFAULTLIB:"msvcrt.lib" /NODEFAULTLIB:"libcmtd.lib" /NODEFAULTLIB:"mfc80d.lib" /NODEFAULTLIB:"LIBCMTD.lib"
r1 - 02 Sep 2007 - 23:02:39 - StephaneLenclud
Copyright © 2006-2008 by the contributing authors. All right reserved.
Ideas, requests, problems send us feedback.
Syndicate this site RSSATOM