I ran into a really nasty linker error when I start using the debugging discussed here.
I managed to narrow it down to the new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
construct. As soon as this overload of the new operator was used I get error LNK2005: "void __cdecl operator delete(void *,int,char const *,int)" (??3@YAXPEAXHPEBDH@Z) already defined in ...
If I exclude that object file from the linking process it just points me to another. I haven't verified this but I'm quite sure they all of these object files that clash with MFC use the debug new version of the operator.
This lead me on a wild goose chase because if you Google this error, all the evidence will tell you that you're mixing CRT and MFC stuff in the wrong order and sure enough, this is what I was doing.
I went trough all my object files and libraries with dumpbin /directives
and made sure that the order of linking was the right one, despite of all this I never got past that error.
Is the CRT debugging technique inherently incompatible with MFC or is there an explanation for this?
I'm not very knowledgeable about MFC and I'm trying to move away from MFC entirely but I'd like to get this to work until that happens.