调试_new错误未声明的标识符 [英] debug _new error undeclared identifier

查看:335
本文介绍了调试_new错误未声明的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
一个有错误,我不知道如何解决.错误是此行
if((m_pInputBuffer [i] = new WAVEHDR [sizeof(WAVEHDR)])== NULL)
和错误消息错误C2065:"DEBUG_NEW":未声明的标识符
有什么帮助吗?谢谢

hello
a have an error and i don''t know how resolve it .the error is this line
if( ( m_pInputBuffer[i] = new WAVEHDR[ sizeof(WAVEHDR)] ) == NULL )
and the error message error C2065: ''DEBUG_NEW'': undeclared identifier
any help ? thanks

推荐答案

如果您正在开发MFC应用程序,则必须输入:
If your developing an MFC application then you have to put:
#include "stdafx.h"


在源文件的顶部.


at the top of your source file.


除了您陈述的问题外,这看起来还很可疑:
In addition to your stated problem, this looks suspicious:
new WAVEHDR[ sizeof(WAVEHDR)]



您可能是
之一



You probably mean one of

(WAVEHDR*) new char[ sizeof(WAVEHDR)]




or

new WAVEHDR[1]




or

new WAVEHDR


DEBUG_NEW [
DEBUG_NEW[^] is used to help find memory allocation problems.

The easiest way to fix this is to ensure that you include afx.h in your file.

Alternatively, you will have to search for the statement #define new DEBUG_NEW in your project and delete it (don''t delete it from any system headers)


这篇关于调试_new错误未声明的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆