Ogre/PhysX/malloc error

Started by
3 comments, last by Andreas Persson 17 years, 5 months ago
Hi I am trying to implement PhysX into Ogre3d but when I compile I get an error in malloc.h and NxUserAllocator.h wich also contains malloc functions same as in malloc.h. How do I get past this problem? Here is a few of the errors I get: malloc.h(123): error C2761: 'Ogre::MemoryManager &Ogre::MemoryManager::instance(void)' : member function redeclaration not allowed NxUserAllocator.h(496): error C3254: 'NxUserAllocator' : class contains explicit override 'instance' but does not derive from an interface that contains the function declaration
Casual game dev www.apgames.se
Advertisement
Solved the previous problem. But no I get a different one

NxMath.h(42): fatal error C1189: #error : Error: min or max is #defined, probably in <windows.h>. Put #define NOMINMAX before including windows.h to suppress windows global min,max macros.

I am defining NOMINMAX before I include windows.h but I still get this error. It works if I include the physics header before the windows.h but then I dont get any access to it since it is in my main file. If I try to include it in any other place I get the error above.
Casual game dev www.apgames.se
Have you given thought to using NxOgre? You can read in the Addons section here: http://www.ogre3d.org/phpBB2addons/

I just started using NxOgre recently and it compiles without any problems (well, one small problem, but it tells in the comments how to fix it.)
Put NOMINMAX in your project options or properties: there should be a box labelled "preprocessor definitions" or something similar. Add it in there. That takes the place of a #define and applies to all files regardless of the order of inclusion.
Quote:Original post by Kylotan
Put NOMINMAX in your project options or properties: there should be a box labelled "preprocessor definitions" or something similar. Add it in there. That takes the place of a #define and applies to all files regardless of the order of inclusion.


Thanks got it working. :)
Casual game dev www.apgames.se

This topic is closed to new replies.

Advertisement