PRB: C2061 Error Generated When DEBUG_NEW Used in Application

Article translations Article translations
Article ID: 95198 - View products that this article applies to.
This article was previously published under Q95198
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

SYMPTOMS

An attempt to compile an application that changes the definition of the "new" operator to DEBUG_NEW fails and the compiler generates the following message:
error C2061: syntax error : identifier 'p'

CAUSE

The statement "#define new DEBUG_NEW" precedes an IMPLEMENT_SERIAL or an IMPLEMENT_DYNACREATE macro call.

RESOLUTION

Modify the source code to place the DEBUG_NEW definition after all statements that call the IMPLEMENT_SERIAL or IMPLEMENT_DYNCREATE macros. For more information, see Chapter 15 of the Microsoft Visual C++ "Class Library User's Guide."

MORE INFORMATION

This behavior has changed for Visual C++ version 4.0. However, if you build an application that makes use of DEBUG_NEW with Visual C++ 4.0, and then attempt to build that application in Visual C++ version 2.x, you will need to move the #define DEBUG_NEW as discussed above.

Properties

Article ID: 95198 - Last Review: October 21, 2013 - Revision: 3.1
APPLIES TO
  • Microsoft Foundation Class Library 4.2, when used with:
    • Microsoft C/C++ Professional Development System 7.0
    • Microsoft Visual C++ 1.0 Professional Edition
    • Microsoft Visual C++ 1.5 Professional Edition
    • Microsoft Visual C++ 1.51
    • Microsoft Visual C++ 1.52 Professional Edition
    • Microsoft Visual C++ 1.0 Professional Edition
    • Microsoft Visual C++ 2.0 Professional Edition
    • Microsoft Visual C++ 2.1
Keywords: 
kbnosurvey kbarchive kbbug kbdebug kbprb KB95198

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com