Visual Studio 2008, detecting mem leaks, the symbol '__FILE__' is not defined

Discussion in 'Visual C++ .Net' started by DN Admin, Apr 13, 2012.

  1. DN Admin

    DN Admin Administrator
    Staff Member

    United States
    Aug 7, 2010
    Likes Received:
    Joliet, IL U.S.A.
    I am trying to identify memleaks in my c++ program. I use Visual Studio 2008.
    I have found a few tutorials dealing with identifying memleaks while using new, not malloc, for memory allocation and this is what i have defined on top of my main:

    #define __STDC_CONSTANT_MACROS <br/>
    #ifdef _DEBUG<br/>
    #define _CRTDBG_MAP_ALLOC<br/>
    #include <stdlib.h><br/>
    #include <crtdbg.h><br/>
    #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)<br/>
    #define new DEBUG_NEW<br/>

    unfortunately I get tons of errors, which you can see here:
    But I think I have found the problem: there is neighter __FILE__ nor __LINE__ defined. When I click "RMB->go to definition" OR "RMB->go to declaration" on __FILE__ or __LINE__ i get: "the symbol '__FILE__' is not defined"
    and the symbol '__LINE__ ' is not defined respectively.

    How should I solve this?

    View the full article

Share This Page