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"