Cry about...
MS-Windows Troubleshooting


error C2833: 'operator DEBUG_NEW' is not a recognized operator or type


Symptom:

When compiling an application (in which a header file has just been changed) the Microsoft Visual C++ compiler generates the compiler error:

... \include\crtdbg.h (536) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type

followed by in excess of 20 errors.

Cause

Normally the compiler error C2833 means that the specified symbol is not recognised and this indicates a simple programming error.

This specific error, in ‘crtdbg.h’ involving ‘operator DEBUG_NEW’, is a compiler bug. This bug has been observed in Visual Studio 5 and Visual Studio 6 (up to and including service pack 5).

Possible Remedies:

These remedies deal with the compiler bug only.

  • Try recompiling. This sometimes cures the problem.
  • If recompiling does not cure the problem then ‘clean’ the affected project and rebuild. This has always been observed to cure the problem.
  • Anders Musikka has contributed the following tip: It is not necessary to do a full clean of the project and rebuild. You can just delete the xxx.pch file in the debug/release  directory and recompile the failed .cpp file(s).

Whilst it is in no way conclusive, this bug may be related to the project pre-compiler header settings. I have noticed that it only seems to affect projects where the precompiled headers is set to ‘automatic use of precompiled headers’.



About the author: is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.