[Bleeding] Problems compiling in Release mode

Night Elf

26-03-2008 21:47:06

I just downloaded Bleeding from the SVN and managed to compile the solution (VC8) in Debug mode without problems. But it doesn't seem to work in Release. Here's the output (a fragment form the beginning):

Error 2 error C2065: 'ptr' : undeclared identifier c:\libs\nxogrebleeding\nxogre\include\NxOgreContainer.h 340
Error 3 error C2541: 'delete' : cannot delete objects that are not pointers c:\libs\nxogrebleeding\nxogre\include\NxOgreContainer.h 340
Error 4 error C2440: '=' : cannot convert from 'NxOgre::HTMLLog' to 'NxOgre::Log *' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgrePhysXDriver.cpp 137
Error 5 error C2065: 'ptr' : undeclared identifier c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 104
Error 6 error C2541: 'delete' : cannot delete objects that are not pointers c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 104
Error 7 error C2541: 'delete' : cannot delete objects that are not pointers c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 118
Error 8 error C2541: 'delete' : cannot delete objects that are not pointers c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 121
Error 9 error C2541: 'delete' : cannot delete objects that are not pointers c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 126
Error 10 error C2440: '=' : cannot convert from 'NxOgre::Scene' to 'NxOgre::Scene *' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 165
Error 11 error C2440: '=' : cannot convert from 'NxOgre::Scene' to 'NxOgre::Scene *' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 168
Error 12 error C2541: 'delete' : cannot delete objects that are not pointers c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 180
Error 13 error C2541: 'delete' : cannot delete objects that are not pointers c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 310
Error 14 error C2065: 'ptr' : undeclared identifier C:\Libs\NxOgreBleeding\NxOgre\include\NxOgreGroup.h 117
Error 15 error C2541: 'delete' : cannot delete objects that are not pointers C:\Libs\NxOgreBleeding\NxOgre\include\NxOgreGroup.h 117
Error 16 error C2541: 'delete' : cannot delete objects that are not pointers C:\Libs\NxOgreBleeding\NxOgre\include\NxOgreGroup.h 159
Error 17 error C2440: '=' : cannot convert from 'NxOgre::FixedSceneController' to 'NxOgre::SceneController *' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 221
Error 18 error C2440: '=' : cannot convert from 'NxOgre::VariableSceneController' to 'NxOgre::SceneController *' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 224
. . . etc . . .

It seems to be a problem with these definitions (NxOgreAllocator.h line 59):
#else
#define NxNew(T)
#define NxNewDescribed(T, D)
#define NxWatch(T, PTR)
#define NxWatch(T, PTR, D)
#define NxDelete delete ptr;ptr = 0;
#endif

They don't really look OK to me... but I have little experience using preprocessor macros. What can I do about it?

betajaen

26-03-2008 21:52:53

Yep. I only noticed it after I committed it to SVN, the fix should be:

#else
#define NxNew(T) new T
#define NxNewDescribed(T, D) new T
#define NxWatch(T, PTR)
#define NxWatchDescribed(T, PTR, D)
#define NxDelete(ptr) delete ptr;ptr = 0;
#endif

Night Elf

26-03-2008 22:05:47

Ok, now it looks better, thanks. But I still get some errors:
Error 1 error C2146: syntax error : missing ';' before identifier 'HTMLLog' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgrePhysXDriver.cpp 137
Error 2 error C2512: 'NxOgre::Scene' : no appropriate default constructor available c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 165
Error 3 error C2146: syntax error : missing ';' before identifier 'Scene' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 165
Error 4 error C2512: 'NxOgre::Scene' : no appropriate default constructor available c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 168
Error 5 error C2146: syntax error : missing ';' before identifier 'Scene' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreWorld.cpp 168
Error 6 error C2512: 'NxOgre::FixedSceneController' : no appropriate default constructor available c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 221
Error 7 error C2146: syntax error : missing ';' before identifier 'FixedSceneController' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 221
Error 8 error C2512: 'NxOgre::VariableSceneController' : no appropriate default constructor available c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 224
Error 9 error C2146: syntax error : missing ';' before identifier 'VariableSceneController' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 224
Error 10 error C2512: 'NxOgre::AccumulatorSceneController' : no appropriate default constructor available c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 227
Error 11 error C2146: syntax error : missing ';' before identifier 'AccumulatorSceneController' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 227
Error 12 error C2512: 'NxOgre::NullSceneController' : no appropriate default constructor available c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 230
Error 13 error C2146: syntax error : missing ';' before identifier 'NullSceneController' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 230
Error 14 error C2512: 'NxOgre::FixedSceneController' : no appropriate default constructor available c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 233
Error 15 error C2146: syntax error : missing ';' before identifier 'FixedSceneController' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 233
Error 16 error C2512: 'NxOgre::SceneContactController' : no appropriate default constructor available c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 238
Error 17 error C2146: syntax error : missing ';' before identifier 'SceneContactController' c:\Libs\NxOgreBleeding\NxOgre\source\NxOgreScene.cpp 238
. . . etc . . .

I think every line is similar to this:
scene = NxNew(Scene) Scene(NxCreateID(mScenes.count(), newname), this, p);
Since NxNew(T) is defined as new T, I think the expresion above is not right...

betajaen

26-03-2008 22:10:31

Yep. I've redid the Macro last week, I must of pasted the changed version. Try it without the "T" on the "new" macros.

Night Elf

26-03-2008 23:42:13

Thanks, that does the trick.