Sign in to follow this  

Problems compiling Paul Nettle's Memory Manager in DevCpp

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to compile Paul Nettle's Memory Manager in DevCPP and i am getting some errors. My whole project compiles on VC++2003 without any errors or warnings. Here are some of the errors. 792 Source\mmgr.cpp `new_handler' undeclared (first use this function) 792 Source\mmgr.cpp parse error before `=' token Source/mmgr.cpp: In function `void doCleanupLogOnFirstRun()': Source/mmgr.cpp:290: `unlink' undeclared (first use this function)

Share this post


Link to post
Share on other sites
That code was written for VC++. If you are going to need this to compile for both VC and gcc (MingW), then you will need to make some changes. For the two errors you listed, try this:


// find this
#include <new>

// replace it with
#if defined(_MSC_VER)
# include <new>
#elif defined(__GNUC__)
# include <new.h>
# define unlink _unlink
#endif




I foud the solutions by doing 'Find in Files' on new_handler and unlink in the MingW include directory. If anymore compiler-compatibility errors arise, you should be able to do the same to determine how to fix them.

Share this post


Link to post
Share on other sites

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this