Error Compiling NxOgre

mnm23

24-07-2006 17:46:13

Hows it going. I have been using Ogre for about 6 months now and i have been using OgreNewt for about 4 months, so i am prety familiar with a lot of the errors that come up. I am currently trying to use nxOgre. I have compiled all the tutorials without a problem. I am adding nxOgre to some of my old ogre projects where i was using ogreNewt. I am receiving this error when trying to compile.


1>c:\novodex\v2.3.3\sdks\foundation\include\NxUserAllocator.h(381) : error C2143: syntax error : missing ';' before '.'
1>c:\novodex\v2.3.3\sdks\foundation\include\NxUserAllocator.h(381) : error C3254: 'NxUserAllocator' : class contains explicit override 'instance' but does not derive from an interface that contains the function declaration
1>c:\novodex\v2.3.3\sdks\foundation\include\NxUserAllocator.h(381) : error C2838: 'instance' : illegal qualified name in member declaration
1>c:\novodex\v2.3.3\sdks\foundation\include\NxUserAllocator.h(381) : error C2238: unexpected token(s) preceding ';'
1>c:\novodex\v2.3.3\sdks\foundation\include\NxUserAllocator.h(397) : warning C4002: too many actual parameters for macro 'malloc'


I am using latest Dagon release. I am using VS 8. I also have made sure all nxOgre.h came before ogre.h. I have looked through this forum and couldnt find anything to help me out with something i havent already implemented myself. Any help is much appreciated.

betajaen

24-07-2006 18:46:14

Hmm, Odd.

Is this when you compile your own NxOgre application, NxOgre itself or even the tutorials?

mnm23

24-07-2006 18:52:44

Only when i compile my own projects. The nxOgre tutorials work fine. Now these projects compiled fine with ogreNewt and i undesrstand that there are a lot of differences in code between the two but i am just implementing basic movement here.

betajaen

24-07-2006 22:05:59

Alright, I'm guessing it's an include thing. I know you said you checked to see if the nxOgre.h header is before Ogre.h but check again, it can be sneaky. :wink:

mnm23

25-07-2006 02:49:48

I dont understand something with NxOgre, why is it that you have to inlude nxOgre.h everywhere ogre.h is even where nxOgre isnt being used. Maybe im thinking to much in the way of ogreNewt where you only added the include when you were calling the newton software. Basically how i fixed it was everywhere i had ogre.h i put nxOgre.h above it. They way i had it before when it was giving me problems was i only added it to places where i would be calling PhysX software and in the main.cpp. I dont know but im just glad it works.

Now im getting a different error.

1c:\novodex\v2.3.3\sdks\foundation\include\NxMath.h(38) : 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.


So as it says there i did just that i put #define NOMINMAX before all windows.h includes and i still get this error. Thanks again for help.

mnm23

25-07-2006 03:06:12

Hey betajaen,

Dont worry about the previous error. Im using raknet and i forgot within racknets header files they call windows.h so i had to add that #define NOMINMAX before all the raknet client/server includes. Thanks again.

betajaen

25-07-2006 08:40:23

Glad you have it sorted.

The reason or reasons why NxOgre.h has to be included before everything else is that the PhysX library uses the global namespace, so you have a problem with having two Controller classes (PhysX's and Ogre's). I get around that with a typedef.

A bit silly really.

mnm23

27-07-2006 15:57:15

Here is another compiling error. I dont think it has anything to do with nxOgre but im not sure. I didnt have this error before nxOgre, but i might have changed something.

1>Linking...
1>AnimationBlender.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ControllerManager::~ControllerManager(void)" (__imp_??1ControllerManager@@QAE@XZ)
1>AnimationBlender.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ControllerManager::ControllerManager(void)" (__imp_??0ControllerManager@@QAE@XZ)
1>MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
1>C:\NxOgre\bin\Release\Practice.exe : fatal error LNK1120: 3 unresolved externals

I at first thought it had something to do with that class (AnimationBlender) but it was just the order in which it was proccessing the link. I have looked on google and the other ogre & ogreAddon forums but "unresolved external symbol" is such a vague error it is hard to pin point. Just in case you ask, i have included all the propper libraries (eg. ogremain.lib, nxOgre.lib, ois.lib, .... etc). Any suggestions is much appreciated. Thanks.

betajaen

27-07-2006 16:54:33

I don't have a clue. You have the same setup as me (almost) and many others here, and I have no idea why it isn't working.

Are you using another other libraries at the same time except for Ogre and NxOgre?

mnm23

27-07-2006 17:05:07

Yes i am. The libraries i am using is OIS, RakNet, SDL, and smpeg. I have compiled the libraries in release mode for each of the libraries mentioned with the exception of RakNet but i currently am not calling that in my code.

mnm23

27-07-2006 17:10:32

I have found on google some info regarding nxOgre and ogre. It says that they both call on the controller::manager, but that would have been fixed by me adding the nxOgre.h above each ogre.h through out the project. I even tried taking away the namespace Ogre; and just adding ogre where its needed because nxOgre and Ogre call on a lot of the same stuff. That didnt work either. Does any one have any code where they had converted an older or current Ogre code/tutorial to use nxOgre, just in case im over looking something. Thanks for all the help.

mnm23

27-07-2006 18:02:47

Ok so i beleive i have found out what my problems is here. I think anyway, LOL. The problem is with OIS. I first installed OIS 5 and when i try to compile it in release mode it doesnt give me a ois.dll, but when i compile it in debug mode it gives me a ois_d.dll. Then i went to OIS 7. In OIS 7 i had the same problem, so i fudge the library output to give me a ois.dll instead of a .lib then went back and changed it to .lib so i could have both. This is probably whats causing my problems but i have no idea how to correct it. Only thing i can think of relating to my problem, everything with Ogre and nxOgre looks fine.

mnm23

28-07-2006 00:59:29

Actually i was wrong in the above post. It has nothing to do with OIS. Its actually a problem with Ogre/nxOgre( i think, LOL). The controllermanager is a part of Ogre. It must be something that happens when i add nxOgre. Any thoughts. Thanks.

magura

28-07-2006 02:03:31

i havent read everything that youve tried, so sorry if this is irrelevant.

but you might want to try the following



#include <OgreNoMemoryMacros.h>

#include<NXOGRE AND OTHER NON OGRE HEADERS HERE>

#include <OgreMemoryMacros.h>

#include <OGRE HEADERS HERE>

mnm23

28-07-2006 19:21:16

Hey magura, thanks for the suggestion but that didnt change anything. I still get this error.


1>Linking...
1>AnimationBlender.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ControllerManager::~ControllerManager(void)" (__imp_??1ControllerManager@@QAE@XZ)
1>AnimationBlender.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ControllerManager::ControllerManager(void)" (__imp_??0ControllerManager@@QAE@XZ)
1>C:\NxOgre\bin\Release\Practice.exe : fatal error LNK1120: 2 unresolved externals

betajaen

28-07-2006 20:36:02

Hmm... That just refers to making the class "exported" with the Ogre.dll properly.

Try asking the main forums, you'll probably get a better response that way. Since we've tracked it down to the Ogre part.

Also what happens if you *don't* include NxOgre?

M@gg!

08-08-2006 19:20:47

Right at the moment I was having a similar problem. I forgot to add the nxOgre.lib to the linker :oops: .

In addition I had to add from PhysX:

NxCharacter.lib
NxCooking.lib
NxExtension.lib
PhysLoader.lib

I'm using Microsoft Visual Studio 2005 Professional Edition

Perhaps this helps.

mnm23

08-08-2006 19:38:56

Thanks M@gg!. That was what i was missing. We had already solved it in the main ogre forum but i forgot to repost in here with a link. Sorry about that.

http://www.ogre3d.org/phpBB2/viewtopic.php?t=22930