执行new的时候,系统错误提示:error C2065: 'THIS_FILE' : undeclared identifier
请问是什么原因???? 谢谢原码如下:
char *p;
p = new char[20];

解决方案 »

  1.   

    'THIS_FILE' 没有定义不是代码错误的
      

  2.   

    'THIS_FILE'未定义,与new操作无关
      

  3.   

    你定义一个THIS_FILE
    #define THIS_FILE 试试
      

  4.   

    'THIS_FILE' 因该是VC默认定义好的,怎么还要自己定义啊???
      

  5.   

    TO:  tangjun237(tangjun2371)我试过了,#define  THIS_FILE可好象不行,提示的错误更多了。
      

  6.   

    把THIS_FILE那些预编译部分删掉
      

  7.   

    new 操作没有问题,建议你把相关的代码贴出来
      

  8.   

    THIS_FILE  是啥东西?在哪定义的
      

  9.   

    文件头部应该有这个, 可能被你删掉了
    #ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif
    用release版编译一下试试.