|
-
April 3rd, 2012, 09:21 PM
#1
Detecting memory leaks using _CrtDumpMemoryLeaks
Hi,
This is my first time using the CRT library for detecting memory leaks, and I'm using Visual C++ 2003. As mentioned in this website (http://msdn.microsoft.com/en-us/library/x98tx3cf.aspx), I included the statements in my program
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
followed by another header file that contains all other header files like stdio.h, windows.h and structure/function declarations. I also have
_CrtDumpMemoryLeaks();
right before my function returns.
When I tried to build my program, I get the errors
error C2059: syntax error: 'constant'
error C2059: syntax error: 'string'
error C2733: second C linkage of overloaded function '_aligned_malloc_dbg' not allowed
for the function prototypes in malloc.h, e.g.
_CRTIMP void * __cdecl calloc(size_t, size_t);
_CRTIMP void * __cdecl free(void *);
etc.
How do I run the memory check debugger correctly?
Thank you.
Regards,
Rayne
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|