using nxOgre in my project

celic

13-03-2006 09:12:20

Hi, betajaen!

I'm using the StateManager and I've just tried to add nxOgre to it.
When I include the "nxOgre.h" file - I get an error saying "Controller - ambigous definition" and points me to the PhyX controller header.

Sorry, I have no more details at the moment.

betajaen

13-03-2006 09:46:09

Hi, betajaen!

I'm using the StateManager and I've just tried to add nxOgre to it.
When I include the "nxOgre.h" file - I get an error saying "Controller - ambigous definition" and points me to the PhyX controller header.

Sorry, I have no more details at the moment.


Easy one,

Include NxOgre.h before any Ogre libraries.

celic

13-03-2006 10:05:28


Easy one,
Include NxOgre.h before any Ogre libraries.


Do you mean like this:
#include "nxOgre.h"
#include "Ogre.h"


This doesn't solve the problem :(

betajaen

13-03-2006 13:07:48

That's really odd, you must be referencing Ogre before NxOgre is included, as PhysX has a class called Controller in the global namespace which conflicts with class with the same name in the Ogre namespace.

NxOgre automagically fixes this; but this is the error and solution you have.

celic

13-03-2006 13:52:18

Thanks, betajaen!
I'll try this once more :oops:

celic

15-03-2006 11:03:23

Hi, betajaen!

I'm having the same problems at compilation... :(
Maybe this is caused by the StateManager I use?

:roll:

betajaen

15-03-2006 13:14:19

It might, but it's the issue I said.

Try putting include NxOgre.h at the very first line of your application, even main.cpp or stdafx.h

But if Aegia put PhysX in it's own Namespace this wouldn't happen. :)

celic

15-03-2006 13:55:50

No success, I think I've tried all the combinations :roll:
Even the order of additional include dirs don't help :(

betajaen

15-03-2006 14:54:09

Hmm...This is going to be difficult.

In NxOgre_include.h, there is a few lines that say:-


#include <NxPhysics.h>
#include "ControllerManager.h"

typedef ::ControllerManager nxControllerManager;


Copy these, and put them before ANY includes in your application and see if it runs then.

celic

16-03-2006 08:58:26

Sorry, betajaen for making your head spin :D

I've found the reason of the problem, it was the include order, indeed.
I've just found the right place in the code where the "nxOgre.h" should be included.

Thank you very much!! :)

Gila

19-03-2006 20:08:26

I'm getting exactly the same problem in my project... I've tried adding


#include <OgreNoMemoryMacros.h>
#include "nxOgre.h"
#include <OgreMemoryMacros.h>
#include "ControllerManager.h"
typedef ::ControllerManager nxControllerManager;


to the top of every .h file in my project (and every BLAH.cpp includes the BLAH.h on the first line) but still those link errors... Also if that is the solution I don't really fancy adding that lot to every .h in the project, it just seems wrong... :?

celic - do you have full details for how you fixed the problem?

Any help much appreciated as always :)

betajaen

19-03-2006 22:15:03

Couldn't you use a stdafx.h (or whatever you want to call it) which includes all your library headers in one file, then you just include that in each of your source files when needed?

Just make sure you include NxOgre.h before Ogre.h though :)

Gila

19-03-2006 22:28:47

Ahh my mistake - it wasn't that error at all, it was a link error with unresolved external symbol ControllerManager::ControllerManager...

I'd forgotten to add the .lib files to the linker input :roll:

Hurrah!

Gila

19-03-2006 22:34:47

Couldn't you use a stdafx.h...

Yeah that is much neater... cheers!