From: Girish on
Hi,
I working in finding out the memory leak in the application which was
developed in vc++2005. I am using _CrtMemCheckpoint function to find
out the memory leak these function will be working only when the
application is in debug mode and the project setting should in /MDD
or /MTD .
When ever I change my setting from /MD to /MDD I get a compiler error
Error 251 error C2370: 'THIS_FILE' : redefinition;
different storage class
i.e error is at
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
#pragma once
static char THIS_FILE[] = __FILE__;
#endif

When I try to remove this and build I can build the application but it
crashes .
Could you please help me out what is changes I need to make to run
the application successfully.

Thanks in Advance,
Regards,
Girish
From: Tom Serface on
Could you have this in more than one .h file where one is included in
another so there really are two definitions?

Tom

"Girish" <girishog(a)gmail.com> wrote in message
news:3acca237-b45f-49dd-ba84-49902867ffd8(a)h27g2000yqm.googlegroups.com...
> Hi,
> I working in finding out the memory leak in the application which was
> developed in vc++2005. I am using _CrtMemCheckpoint function to find
> out the memory leak these function will be working only when the
> application is in debug mode and the project setting should in /MDD
> or /MTD .
> When ever I change my setting from /MD to /MDD I get a compiler error
> Error 251 error C2370: 'THIS_FILE' : redefinition;
> different storage class
> i.e error is at
> #ifdef _DEBUG
> #define new DEBUG_NEW
> #undef THIS_FILE
> #pragma once
> static char THIS_FILE[] = __FILE__;
> #endif
>
> When I try to remove this and build I can build the application but it
> crashes .
> Could you please help me out what is changes I need to make to run
> the application successfully.
>
> Thanks in Advance,
> Regards,
> Girish