Sign in to follow this  
Andreas Persson

Ogre/PhysX/malloc error

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
HexiDave    158
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.)

Share this post


Link to post
Share on other sites
Kylotan    9881
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.

Share this post


Link to post
Share on other sites
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. :)

Share this post


Link to post
Share on other sites

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