C2065, C2039, C4430 when compiling NxOgre, Ogr[...]-solved-

Protector

12-11-2007 15:56:27

Hi there,
OS: Vista
Visual C++ 2005 Express with SP1 and SP1 for Vista is installed and setup, also the PSDK

I did the following:

Downloaded and installed Ogre3D 1.4.5 (prebuild SDK)
Tried to compile the samples, after some problems I could compile Demo_Smoke.exe, but it crashes without an error message.
I checked a precompiled sample (Demo_Shadows.exe), it also crashes when using the 1.4.5 dlls.
When using older dlls, Demo_Shadows.exe runs without problems, but Demo_Smoke.exe shuts down with an error message telling that WindowEventListener couldn't be found.

Downloaded and installed Ageia PhysX drivers and SDK.
Tried to compile the samples, but got many unresolved externals.
I added paths for the linker and paths for include files, but I still get unresolved externals.
""float __cdecl getCurrentTime(void)" (?getCurrentTime@@YAMXZ)" in Funktion ""public: __thiscall PrefsRenderer::PrefsRenderer(void)" (??0PrefsRenderer@@QAE@XZ)".

Today I learned about NxOgre and I was hoping it could help me find and solve my problems.
I downloaded NxOgre, following the steps on the page.
When I compile the project, I get a bunch of errors, which seem a bit strange. For example:

1>d:\work\nxogre\nxogre\include\nxogreworldblueprint.h(58) : error C2039: 'cookerThreadMask': Ist kein Element von 'NxPhysicsSDKDesc'
1> d:\work\ageia physx sdk\v2.4.4\sdks\physics\include\nxphysicssdk.h(83): Siehe Deklaration von 'NxPhysicsSDKDesc'

I took a look at the class "NxPhysicsSDKDesc" and there is no such thing as "cookerThreadMask".
Same goes for NxPruningStructure, NxThreadPriority and many others.

Anything that could help me out with the above problems is appreciated. Thank you for reading and thank you for your great work.

BloodyFanatic

12-11-2007 16:11:58

Today I learned about NxOgre and I was hoping it could help me find and solve my problems.
I downloaded NxOgre, following the steps on the page.
When I compile the project, I get a bunch of errors, which seem a bit strange. For example:

1>d:\work\nxogre\nxogre\include\nxogreworldblueprint.h(58) : error C2039: 'cookerThreadMask': Ist kein Element von 'NxPhysicsSDKDesc'
1> d:\work\ageia physx sdk\v2.4.4\sdks\physics\include\nxphysicssdk.h(83): Siehe Deklaration von 'NxPhysicsSDKDesc'

I took a look at the class "NxPhysicsSDKDesc" and there is no such thing as "cookerThreadMask".
Same goes for NxPruningStructure, NxThreadPriority and many others.

Anything that could help me out with the above problems is appreciated. Thank you for reading and thank you for your great work.


i don't know why the newest ogre isn't working for you and won't investigate, because it doesn't belong to this addon forum ;)

but for your compiling problems with NxOgre: Which PhysX SDK version do you use? It seems like v2.4.4 which is a very old one... download the v2.7.2, this should work.

Protector

12-11-2007 16:31:52

Thank you for your answer.
I use the latest version v2.7.2, all paths are setup correctly in VC++

D:\Work\AGEIA PhysX SDK\v2.7.2\SDKs\NxCharacter\include
D:\Work\AGEIA PhysX SDK\v2.7.2\SDKs\PhysXLoader\include
D:\Work\AGEIA PhysX SDK\v2.7.2\SDKs\Physics\include
D:\Work\AGEIA PhysX SDK\v2.7.2\SDKs\Foundation\include

betajaen

12-11-2007 16:41:52

If your failing to compile the Ogre Samples AND the PhysX ones, then something is very wrong with your computer.

See if you can get those working before you start on NxOgre, else your trying to build a house on a very dodgy foundation.

Protector

12-11-2007 22:22:45

Okay, I removed and reinstalled everything. NxOgre compiles fine, but when using it in my project with the simple sample code:

using namespace NxOgre;
World *mWorld = new World();
Scene* mScene = mWorld->createScene("Main",mSceneMgr, "gravity: yes, floor: yes");
Body *myBody = mScene->createBody("cube.1m.mesh",new CubeShape(1,1,1),Vector3(0,3.5,0), "mass: 10");

I get the following errors:

error C2065: 'mSceneMgr': nichtdeklarierter Bezeichner
error C3861: "Vector3": Bezeichner wurde nicht gefunden.

I tried to fix that by adding the following line:

Ogre::SceneManager *mSceneMgr;

and changing the last line to:

Body *myBody = mScene->createBody("cube.1m.mesh",new CubeShape(1,1,1),Ogre::Vector3(0,3.5,0), "mass: 10");

It compiles, but after starting the exe, it just crashes.

Thank you again for helping me.

betajaen

13-11-2007 09:07:11

Did you create the SceneManager and shove it's instance into that pointer?

Protector

13-11-2007 09:46:31

Yes, I did. When I start the program, the console prints this:

10:45:04: Creating resource group General
[...]
10:45:05: Particle Affector Type 'DeflectorPlane' registered
10:45:05: Plugin successfully installed
10:45:05: Loading library .\Plugin_BSPSceneManager
10:45:05: Installing plugin: BSP Scene Manager
10:45:05: Plugin successfully installed
10:45:05: Loading library .\Plugin_OctreeSceneManager
10:45:05: Installing plugin: Octree & Terrain Scene Manager
10:45:05: Plugin successfully installed
10:45:05: Loading library .\Plugin_CgProgramManager
10:45:05: Installing plugin: Cg Program Manager
10:45:05: Plugin successfully installed
10:45:05: *-*-* OGRE Initialising
10:45:05: *-*-* Version 1.4.0 (Eihort)

Afterwards Vista just tells me that main.exe doesn't work anymore.

//Edit:
I tracked down the cause:

World *mWorld = new World();

With this line the application crashes, without not. I tried to use different arguments, but it didn't change anything.

betajaen

13-11-2007 10:09:42

What does the NxOgre log say?

Protector

13-11-2007 10:30:39

I only have that Ogre log. Nothing else is printed in the console window or created as file in the folder.

betajaen

13-11-2007 10:39:04

Alright. Most likely the SystemSoftware (PhysX Drivers) aren't installed, or the Ogre Root pointer is invalid. But since the Ogre log exists I'm guessing it's the former.

Protector

13-11-2007 10:48:02

PhysX alone compiles fine, the demos run properly. SystemSoftware is installed, latest version.

betajaen

13-11-2007 12:14:29

Right. Let's trace the error. Can you run your application in Debug mode and post a screenshot of where Visual Studio thinks the error is?

Protector

13-11-2007 12:21:40

Unbehandelte Ausnahme bei 0x7661b09e in main.exe: Microsoft C++-Ausnahme: std::bad_alloc an Speicherposition 0x02b0eb30..
http://hltown.de/userftp/hl_protector/temp/debug.png

betajaen

13-11-2007 16:46:27

I can't read assembly like that even when it's in German, go a bit lower and trace it to a library like NxOgre or Ogre.

Protector

13-11-2007 17:47:20

Sorry, it's my first time debugging something. Never had to do it before :/
I'm just getting used to it, it seems to be the Root pointer, as you guessed before. Last dll that was loaded before the error was "asycfilt.dll", VC++ says it's somewehre in kernel32.dll or something like that when it happens.

Error does appear:

void CVideo::initPrograms(void)
{
using namespace Ogre;
Root *mRoot;
SceneManager* mSceneMgr;

mRoot = new Root("plugins.cfg", "ogre.cfg", "Ogre.log");

while(1){int x = 1;};

using namespace NxOgre;
World *mWorld = new World();

[...]


Error does not appear:

void CVideo::initPrograms(void)
{
using namespace Ogre;
Root *mRoot;
SceneManager* mSceneMgr;

while(1){int x = 1;};

mRoot = new Root("plugins.cfg", "ogre.cfg", "Ogre.log");

using namespace NxOgre;
World *mWorld = new World();

[...]

betajaen

13-11-2007 18:34:17

Ogre Root then?

Protector

13-11-2007 20:05:32

Sorry, can you repeat your question a bit more detailled or in another way? I don't quite understand what you want from me now ^^
Thank you again for your patience and your help, I am really thankful for that.

betajaen

13-11-2007 20:23:26

The creation of Ogre is causing the crash.

Protector

14-11-2007 06:55:38

Okay, in that case I did understand your question. I just was hoping there was something else, because that conclusion wasn't helpful, sorry. You could have also said "Your application doesn't work.", it seems a bit sarcastic.
Thank you anyway ;)

betajaen

14-11-2007 09:39:03

Well it's not that, I can't really give you any help with it. Ogre is a massive beast and there could be many sources of problems with it.

Anyway, you have almost the same setup as me. Let's try and fix this problem.

First you said it crashed with the creation of World, and now it's crashing with the creation of Ogre Root?

World as much as I know it crashes on two things; Lack of a Ogre Root pointer and System Software not being installed.

Both of those are fine, so it must be something else.

Protector

14-11-2007 13:40:40

No problem ;)
I know it's hard to help someone with such issues, especially if you do not have complete access to the computer and try for yourself.
I guess I found the problem now, but I cannot test it, as I am in university now. I had Ogre for VC++ 2003 before and installed the 2005 version yesterday. I believe that NxOgre is still using the 2003 versions, I will try to fix that as soon as I am home. I will inform you about the progress afterwards.

Thank you again :)

Protector

17-11-2007 19:14:37

Hello again. I solved all the problems, it is working now!
Thanks again for your help, betajaen.

Problem I
Ogre crashes when initializing Root.
Fix:
Use

#include <Ogre.h>
#include <NxOgre.h>

instead of only

#include <NxOgre.h>


Problem II:
NxOgre crashes when initializing World.
Fix:
Use Ogre for VC++ 2005 (when using VC++ 2005)

Stupid and simple errors, but still annoying to trace them down ;)