Archived

This topic is now archived and is closed to further replies.

GamerSg

Compiling Paul Nettle's memory manager into a library?

Recommended Posts

I am trying to compile some engine code into a library and when i do not include the memory manager, it compiles fine and produces a lib file. However, when i inlude the memory manager files, it doesnt compile and gives me many (about 224)errors like these: e:\Program Files\Microsoft Visual Studio .NET\Vc7\include\cstdlib(19): error C2039: ''calloc'' : is not a member of ''operator``global namespace'''''' e:\Program Files\Microsoft Visual Studio .NET\Vc7\include\new(76): error C2059: syntax error : ''delete'' Is it even possible to compile the memory manager into a library? I need this because i want to check if my library code is producing any memory leaks.

Share this post


Link to post
Share on other sites
All my individual library modules (8 or so of them) use that memory manager. The only thing I can suggest you try is creating ALL your headers like so;


// disable the memory manager

#include "nommgr.h"

// now have system includes

#include <windows.h>


// turn on the memory manager in all but release builds

// (end user doesn''t want to see our "memleaks.log" )

#ifndef NDEBUG
#include "mmgr.h"
#endif

// now have local includes

#include "myclass.h" // etc




I''m sure the problem you are experiencing is down to the memory manager being active when some system header is included.

Share this post


Link to post
Share on other sites
Thanx man, i didnt noe what that nommgr did until now. Another slight complain is that i get a warning msg like this:

e:\Documents and Settings\Desktop\3D\GameEngine\Source\mmgr.h(41) : warning C4117: macro name ''__FUNCTION__'' is reserved, ''#define'' ignored

Probably nothing serious i guess.

Share this post


Link to post
Share on other sites