PRB: C2061 Error Generated When DEBUG_NEW Used in Application

This article was previously published under Q95198
This article has been archived. It is offered "as is" and will no longer be updated.
An attempt to compile an application that changes the definition ofthe "new" operator to DEBUG_NEW fails and the compiler generates thefollowing message:
error C2061: syntax error : identifier 'p'
The statement "#define new DEBUG_NEW" precedes an IMPLEMENT_SERIAL or anIMPLEMENT_DYNACREATE macro call.
Modify the source code to place the DEBUG_NEW definition after allstatements that call the IMPLEMENT_SERIAL or IMPLEMENT_DYNCREATEmacros. For more information, see Chapter 15 of the Microsoft VisualC++ "Class Library User's Guide."
This behavior has changed for Visual C++ version 4.0. However, if you buildan application that makes use of DEBUG_NEW with Visual C++ 4.0, and thenattempt to build that application in Visual C++ version 2.x, you will needto move the #define DEBUG_NEW as discussed above.
1.00 1.50 2.00 2.10 2.50 2.51 2.52 3.00 3.10 7.00

Article ID: 95198 - Last Review: 10/21/2013 16:46:45 - Revision: 3.1

Microsoft Foundation Class Library 4.2

  • kbnosurvey kbarchive kbbug kbdebug kbprb KB95198