# set_new_handler( ) with memory manager [SOLVED]

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

## Recommended Posts

Hey All, Just in the process of porting over some projects from Visual Studio 6, to the new VS 2K5 Beta. The project I'm working on now is using Fluid Studio's Memory Manager. The memory manager worked great in VS6, but will not compile since I've ported over to VS 2K5. I am getting this error:
mmgr.cpp(791) : error C3861: 'set_new_handler': identifier not found
Which points to these lines of code in the memory manager:
		new_handler	nh = set_new_handler(0);
set_new_handler(nh);
The weird part is that I can still right click the function, and the click go to definition, which does in fact take me to it. So it seems the IDE knows about it, but not the compiler. I also check MSDN, which still has the function listed, so I know it hasn't been removed or something like that. If anyone has any suggestions, I would totally appretiate it! Matt Hughson [Edited by - matthughson on June 4, 2005 4:18:07 PM]

##### Share on other sites
Make sure that the new header is included.

##### Share on other sites
Quote:
 Original post by WashuMake sure that the new header is included.

Yeah, I checked that. It is.

Matt Hughson

##### Share on other sites
Ok, so I tried changing:

#include <new>

to

#include <new.h>

which got rid of the errors mentioned in the previous posts in this thread, however, I now get a linker error:

LINK : fatal error LNK1104: cannot open file 'libcp.lib'

According to MSDN this lib is associated with new and delete, but I'm not sure why I am getting this error.

I also noticed in the MSDN example they use #include <new> without the .h, so I'm wondering if that switch was not the right thing to do.

Update:

Out of curiosity, I completely removed the memory manager from the project. Yet, I still get that linker error. So it would seem that changing to new.h did fix the problem, and the linker error is something new.

Any suggestions on what else to try?

Matt Hughson

##### Share on other sites
ok, ok.

Solution incase anyone runs into the same problem.

Did a find on my computer for that lib file. Turns out it was on there, but in the VS 6 folder. VS2K5 doesn't seem to include it. So all I did was copy the lib file into the lib directory of VS2K5 and now everything works fine.

Matt Hughson

##### Share on other sites
That may be a bad solution.

Note that I am pretty sure in VC7 and later set_new_handler is in namespace standard, so it may be that the code should read:

new_handler nh = std::set_new_handler(0);
std::set_new_handler(nh);

when including which is DEF what you should do. There is a reason that MSVC7 does not include the old library.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634090
• Total Posts
3015432
×