Buliding Debug Problems

independentCreations

27-02-2007 04:02:05

i get some serious errors when i try and build my app in debug in. I have it running all smoothly in release. And now attempting debug. NxOgre compiles fine in Debug and Release. But when i try and build my app, in debug, i get some serious issues, in reference to nxuserallocation.

over 1000 errors :S

example

1>c:\program files\ageia technologies\ageia physx sdk\v2.6.2\sdks\foundation\include\nxuserallocator.h(480) : error C2143: syntax error : missing ';' before '.'
1>c:\program files\ageia technologies\ageia physx sdk\v2.6.2\sdks\foundation\include\nxuserallocator.h(480) : error C3254: 'NxUserAllocator' : class contains explicit override 'instance' but does not derive from an interface that contains the function declaration
1>c:\program files\ageia technologies\ageia physx sdk\v2.6.2\sdks\foundation\include\nxuserallocator.h(480) : error C2838: 'instance' : illegal qualified name in member declaration
1>c:\program files\ageia technologies\ageia physx sdk\v2.6.2\sdks\foundation\include\nxuserallocator.h(480) : error C2238: unexpected token(s) preceding ';'
1>c:\program files\ageia technologies\ageia physx sdk\v2.6.2\sdks\foundation\include\nxuserallocator.h(496) : warning C4002: too many actual parameters for macro 'malloc'
1>c:\program files\ageia technologies\ageia physx sdk\v2.6.2\sdks\foundation\include\nxuserallocator.h(496) : error C2143: syntax error : missing ';' before '.'
1>c:\program files\ageia technologies\ageia physx sdk\v2.6.2\sdks\foundation\include\nxuserallocator.h(496) : error C3254: 'NxUserAllocator' : class contains explicit override 'instance' but does not derive from an interface that contains the function declaration
1>c:\program files\ageia technologies\ageia physx sdk\v2.6.2\sdks\foundation\include\nxuserallocator.h(496) : error C2838: 'instance' : illegal qualified name in member declaration
1>c:\program files\ageia technologies\ageia physx sdk\v2.6.2\sdks\foundation\include\nxuserallocator.h(496) : error C2535: 'void *NxUserAllocator::instance(void)' : member function already defined or declared



and it goes on. All the includes are the same between release and debug within my own app. Seems weird that NxOgre can build without issues.

Seems like on of those visual studio screw ups. Any ideas??

betajaen

27-02-2007 09:20:09

The errors are caused by the memory macros in Ogre, try putting the NxOgre header before the Ogre header.

#include "NxOgre.h"
#include "Ogre.h"

haoto

27-02-2007 16:09:39

FYI, I'm using NxOgre with MFC and it turns out that in debug builds, MFC isn't happy with the word "DEBUG" in nxogre_errors.h. Otherwise they get along well. Keep up the good work :)

betajaen

27-02-2007 17:04:51

I thought I fixed that.

tx

01-03-2007 15:50:11

I also had problem with the DEBUG enumeration. It conflicted with TinyXML.

Fixed it like this where ever DEBUG was used. But I suggest that you change the DEBUG enumeration to something more unique. It is not uncommon that DEBUG is used as a #define.


#ifdef DEBUG
#define DEBUG_TX
#undef DEBUG
#endif
enum errorType {
DEBUG,
CAUTION,
WARNING,
FATAL
};

#ifdef DEBUG_TX
#define DEBUG
#undef DEBUG_TX
#endif


First post here, and great addon btw :D

betajaen

01-03-2007 16:09:36

Thanks ;)

I'll probably prefix that enumerators with ET; ET_DEBUG, ET_CAUTION and so on.