set_new_handler( ) with memory manager [SOLVED]

Started by
4 comments, last by GameDev.net 18 years, 9 months ago
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]
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
Advertisement
Make sure that the new header is included.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Quote:Original post by Washu
Make sure that the new header is included.


Yeah, I checked that. It is.

Matt Hughson
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
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
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
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
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
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.

This topic is closed to new replies.

Advertisement