Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I'm trying to use MemLeakDetection program to trace the memory leaks in my application. The sample program I downloaded works very well but when I tried to incorportate the MemLeakDetection into my application I ran into numerous compilation errors.
I followed the instructions by adding the two header files and one C++ file into my application. My application compiled successfully with the new additions. But when I tried to use the leak detection feature by including MemLeakDetect.h in my main file I got over 100 comnpilation errors. The errors are all in ImageHlp.h and all have something to do with redefinitions. My application does not use ImageHlp.h. It's used by MemLeakDetection program. Most likely it's caused by something trivial but for the life of me I could not figure out what's happening. I simply add one line - #include "MemLeakDetect.h". Following are some of the error messages:

1>c:\program files\microsoft visual studio 8\vc\platformsdk\include\imagehlp.h(63) : error C2011: '_LOADED_IMAGE' : 'struct' type redefinition
1> c:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(60) : see declaration of '_LOADED_IMAGE'
1>c:\program files\microsoft visual studio 8\vc\platformsdk\include\imagehlp.h(557) : error C2011: '_IMAGE_DEBUG_INFORMATION' : 'struct' type redefinition
1> c:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(228) : see declaration of '_IMAGE_DEBUG_INFORMATION'
1>c:\program files\microsoft visual studio 8\vc\platformsdk\include\imagehlp.h(694) : error C2011: '_MODLOAD_DATA' : 'struct' type redefinition
1> c:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(365) : see declaration of '_MODLOAD_DATA'
1>c:\program files\microsoft visual studio 8\vc\platformsdk\include\imagehlp.h(707) : error C2365: 'AddrMode1616' : redefinition; previous definition was 'enumerator'
1> c:\program files\microsoft visual studio 8\vc\platformsdk\include\dbghelp.h(378) : see declaration of 'AddrMode1616'

Could someone please help?

Best Regards
Posted

1 solution

It looks like you refer to this CodeProject article: Memory Leak Detection[^].

If so, why not asking David A. Jones your questions? Locate the section "Comments and Discussions" at the end of this page and use "Add a Comment or Question" to ask your question. The author will receive notification of your post and a chance to reply.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900