The NxOgre for Linux Thread.

betajaen

30-10-2006 23:46:09

Full development log, testing and bug fixes of NxOgre for Linux, this shall be fun.

avee

31-10-2006 02:43:12

Is AGEIA going to release Linux port of the API (the unsupported version)?

I thought they're going to release the port only to developers who had signed a source contract with AGEIA. But if this thread means casual developers can play with PhysX in Linux, yup, this shall be fun.

betajaen

31-10-2006 08:42:03

Well, I have access to the download so it must be.

Harvest

21-11-2006 20:26:21

This is a great development, being unable to use it from linux is my only reason for not using NxOgre.

runixd

20-01-2007 23:11:11

I can't find the linux version anywhere ... betajen, can you confirm the availability and maybe a link ?

betajaen

21-01-2007 11:31:57

I think it's only available to certain people.

LAva

25-01-2007 08:39:50

how is the linux version doing?
any success yet?

I tried to run physX with Ogre in Linux, but it just doesn't work.
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=3309

mfg LAva

DieHard

25-01-2007 20:04:43

If you're talking about the SDK Linux version:
http://devsupport.ageia.com/ics/support ... erID=20829

Must login and then use the link above.

LAva

26-01-2007 18:51:01

I already have the linux physx library and all of the examples for the library are working.

then i tried to make an OGRE project with physx and the library crashed.

so I wanted to know if somebody has an ogre program running with physx yet.

syedhs

27-01-2007 06:31:58

so I wanted to know if somebody has an ogre program running with physx yet.

Everybody here is runing PhysX with Ogre :lol:

LAva

29-01-2007 21:08:56

I know ;-)

I mean in Linux!!

LAva

28-02-2007 20:01:42

I found it!
You just have to deactivate fluids and the hardware support and everything is fine.

I added this defines:
LINUX
CORELIB
NX32
NX_DISABLE_FLUIDS
NX_DISABLE_HARDWARE

Now I have the NxOgre0.4RC3 running with the PhysX2.6.2 on Linux :D

betajaen

28-02-2007 20:47:06

Fantastic! What is more amazing is that I just installed Ubuntu again.

Perhaps there will be an official NxOgre Linux after all!

xabila

01-03-2007 09:25:18

I found it!
You just have to deactivate fluids and the hardware support and everything is fine.

I added this defines:
LINUX
CORELIB
NX32
NX_DISABLE_FLUIDS
NX_DISABLE_HARDWARE

Now I have the NxOgre0.4RC3 running with the PhysX2.6.2 on Linux :D

Really, wich version of gcc do you have ?
I have added these definition too but i have more things to do with gcc 4.0.2 :

1> enum defaultStates, long 0x100000000 it's too big for int , so i change it to 0x1000000 and it's seems ok ? but perhaps there is some implication...

2> every time you define a friend toto, gcc want friend class toto;

3> i have a last error in definition of nxOgre_error.
nxOgre::error’ is implicitly friends with itself
: erreur: cannot declare member function ‘NxUserOutputStream::print’ within ‘nxOgre::error’
And i don't know how to handle it ...

LAva

01-03-2007 16:40:03

I found it!
You just have to deactivate fluids and the hardware support and everything is fine.

I added this defines:
LINUX
CORELIB
NX32
NX_DISABLE_FLUIDS
NX_DISABLE_HARDWARE

Now I have the NxOgre0.4RC3 running with the PhysX2.6.2 on Linux :D

Really, wich version of gcc do you have ?
I have added these definition too but i have more things to do with gcc 4.0.2 :

1> enum defaultStates, long 0x100000000 it's too big for int , so i change it to 0x1000000 and it's seems ok ? but perhaps there is some implication...

2> every time you define a friend toto, gcc want friend class toto;

3> i have a last error in definition of nxOgre_error.
nxOgre::error’ is implicitly friends with itself
: erreur: cannot declare member function ‘NxUserOutputStream::print’ within ‘nxOgre::error’
And i don't know how to handle it ...


I also had to change a few things:

1> You don't have to change the number - just add LL at the end:

STATE_NO_GRAVITY = 0x100000000LL - 0x01,

2> Yes, I also had to add the friend "class" thing.

3> just comment the friend thing out (you don't need it) and delete NxUserOutputStream:: in fornt of the print

Actually there are a few class names in front of methodes in header files. To compile nxOgre with gcc you have to delete this names.

Like in the nxOgre_scene.h:

...
void setWind(Ogre::Vector3 _wind);
Ogre::Vector3 scene::getWind();
...

delete the "scene::" in front of the getWind().

There were also some errors about forward declaration. This happend when some methodes where programmed in the header instead of the cpp file - just move the code to the cpp file and leave just the prototype in the header file.

xabila

02-03-2007 15:04:45

OK thanks.

Is it possible to share me your fix ?
i really want to use NxOgre today...

perhaps by PM ...
Thanks

betajaen

02-03-2007 15:20:17

If it helps. I have NxOgre working in Linux, although the version isn't the one you are working with now.

I just kept at it, although the #defines on the other page really helped.

Ogre is slow as anything though.

xabila

02-03-2007 16:15:31

OK, if it's working with physX 2.6.2 ?

betajaen

02-03-2007 17:17:40

I think you misunderstand, I'm using the same PhysX version as you; 2.6.2 for Linux. But a different NxOgre version, far far different from what you are working with now.

LAva

02-03-2007 17:51:59

I put the fixed source of the nxOgre lib on my web space.
But you have to know, that this is just a quick fix and not tested at all.

http://download.subliminal.at/misc/NxOgre04RC3_Linux.tar.gz

I'm realy looking forward to the official linux release from betajaen.

betajaen

02-03-2007 17:53:41

Well. I think you've made it release worthy there. How about we call it the "Betajaen approved" version than the official one ;)

xabila

02-03-2007 18:08:44

OK thanks !
I'm gonna try it right now

devachan

02-03-2007 18:15:54

that well!! when I decided to occupy NxOgre I had to come to win.

Now the platform is independent!!!. or not? :roll:

xabila

03-03-2007 13:03:12

OK i manage to compile some tutorials. :)

I will give you a report later, but when i have still this in my head
nxOgre_particles.cpp is in include ;)

xabila

04-03-2007 17:46:17

OK it wasn't easy cause i didn't noticed, that the Eihort RC1 was'nt working in my fedora so i used a one or two month old cvs version And it's fine !

So to finished i changed the tutorialApplicationEihort.h about the setupRenderSystem to use the plugin.cfg and not DX9 by default ;)
And it's working.

So thanks a lot LAva and betajaen

betajaen

04-03-2007 18:15:16

I did very little, but thanks ;)

I am deciding what standards should I set; Where the libNxOgre.so should be, where the includes should be, and should I have a script to copy the PhysX headers and libraries to a certain directory.

I'd say I can work myself around Linux, last night I manually worked out the mouse buttons using imwheel and editing xorg.conf, so I could use the back/forward buttons in Firefox. But the directory structure, and why it is like that is still a little iffy to me, and to top it off. Apparently there are different standards for each distro.

So far, for Ubuntu I have:


/usr/local/lib - PhysX, Ogre, and NxOgre libraries.
/usr/local/include - PhysX headers (a directory each for each library or portion of one), Ogre headers, and NxOgre headers.


Does this sound okay?

xabila

04-03-2007 19:00:03

Yes it's ok for me, and copy PhysX header on an only folder is a good idea cause right now i have to do that :
SET(PHYSX /home/xlarrode/MolkWii/PhysX_2.6.2)
INCLUDE_DIRECTORIES(
${OGRE_INC}
${CMAKE_CURRENT_BINARY_DIR}
../include
${PHYSX}/novodex/SDKs/Cooking/Include
${PHYSX}/novodex/SDKs/Foundation/include
${PHYSX}/novodex/SDKs/Framework/include
${PHYSX}/novodex/SDKs/NxCharacter/include
${PHYSX}/novodex/SDKs/NxExtensions/include
${PHYSX}/novodex/SDKs/PhysXLoader/include
${PHYSX}/novodex/SDKs/Physics/include
.)



Maybe /usr/include/PhysX and /usr/include/NxOgre is much more the standard...
And a cmake port maybe cool too ;)

xabila

11-03-2007 16:20:25

Is there a link somewhere to get a PhysX version > 2.6.2, cause it seems that the 0.9 need the 2.7

Thanks

betajaen

11-03-2007 16:28:57

PhysX 2.7.0 for Linux? I don't believe Ageia has released it yet.

Also, I think your referring to 0.6, 0.9 isn't out yet. ;)

xabila

12-03-2007 08:12:15

OK sorry ;)

manowar

20-07-2007 09:56:00

Just to let you know that the linux 2.7.2 SDK is available ! They provide a .rpm and a .deb ! I might try it this weekend if I have the chance.

betajaen

20-07-2007 10:27:44

Fantastic!

It finally gives me an excuse to use Ubuntu again.

vinvin

23-07-2007 07:03:48

That's so great ! Thank you manowar !

I will test this tonight I hope, and tell here if I'm still getting the weird memory allocation errors :)
That will be at least a good thing for the compilation stage and code compatibility.

vinvin

24-07-2007 13:57:01

I finally compiled everything (I will give you the patch when it's all done) but when I want to link with the game using it, I have an error:
/usr/local/lib/libNxOgre.so: undefined reference to `NxReleaseControllerManager'
/usr/local/lib/libNxOgre.so: undefined reference to `NxCreateControllerManager'

These two are not defined in PhysX, nor NxOgre. What am I supposed to do ?

vinvin

25-07-2007 02:20:08

I tried to comment out the two lines referring to that...
And I had the same old segmentation fault I already reported, in the memory allocator when trying to load a mesh.

I guess this is related, because the Character (I don't even know what this is but whatever) is not allocated, and at the first object loading it deeply crashes.

So, what I am supposed to do with that (my previous post) again ?
In the PhysX header file, it is said that these two undefined symbols should be used in replacement of the older ControllerManager, but they don't define it... I guess they have forgotten to compile them in the linux library. I will post on the Ageia forum.

Edit: I've just seen that for windows, you use 4 .lib. In the linux distribution, there are only 3 libs, the missing one is NxCharacter.lib... That's the problem.

Thank you :)

CoffeeMan

26-07-2007 13:04:14

I installed SDK 2.7.2 (all *.debs in tar.gz) on my Ubuntu 7.04 but it dont works :-(

Next little example after compiling print (nil) on screen:


#include <NxPhysics.h>
#include <stdio.h>

NxPhysicsSDK *gPhysicsSDK;

int main(int argc, char* argv[])
{
gPhysicsSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION);
printf("gPhysicsSDK == %p\n", gPhysicsSDK);
if (gPhysicsSDK == NULL)
return -1;
gPhysicsSDK->release();
}


gcc -DLINUX <all physx libraries paths> main.cpp -o test

on screen i get "gPhysicsSDK == (nul)"

persoontje

31-07-2007 22:26:20

Hmm, I have an account on devsupport.ageia.com and I can see the release notes of the SDK 2.7.2 . But I can't find the link to download it :?: Where can I find it ? Or is it still not out for the 'public' :(

betajaen

31-07-2007 22:38:45

It's out for the public. Submit a ticket, they'll sort it out.

persoontje

01-08-2007 11:10:50

I installed SDK 2.7.2 (all *.debs in tar.gz) on my Ubuntu 7.04 but it dont works :-(

Next little example after compiling print (nil) on screen:


#include <NxPhysics.h>
#include <stdio.h>

NxPhysicsSDK *gPhysicsSDK;

int main(int argc, char* argv[])
{
gPhysicsSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION);
printf("gPhysicsSDK == %p\n", gPhysicsSDK);
if (gPhysicsSDK == NULL)
return -1;
gPhysicsSDK->release();
}


gcc -DLINUX <all physx libraries paths> main.cpp -o test

on screen i get "gPhysicsSDK == (nul)"


Hmmm you should compile it with g++ instead of gcc because its c++. And did you link it to the physxs libs?

I compiled and runned it succesfully using this CMakeLists.txt file.
I can send a tar of all the files to you if you want. I use ubuntu too.


PROJECT(PHYSXTEST)

SET (SRC_FILES
main.cpp)

SET (PHYSX_INCLUDEDIR
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include /usr/include/PhysX/v2.7.2/SDKs/Physics/include /usr/include/PhysX/v2.7.2/SDKs/Cooking/Include /usr/include/PhysX/v2.7.2/SDKs/PhysXLoader/include
)

SEPARATE_ARGUMENTS(PHYSX_INCLUDEDIR)

SET (PHYSX_LIBDIR
/usr/lib/PhysX/v2.7.2
/usr/lib)
SEPARATE_ARGUMENTS(PHYSX_LIBDIR)

SET (PHYSX_LIBS
libNxCooking.so
libPhysXLoader.so
libPhysXCore.so)
SEPARATE_ARGUMENTS(PHYSX_LIBS)

LINK_DIRECTORIES( ${PHYSX_LIBDIR})

ADD_DEFINITIONS(-DLINUX=1)

INCLUDE_DIRECTORIES(
${PHYSX_INCLUDEDIR}
)
ADD_EXECUTABLE(main ${SRC_FILES})
TARGET_LINK_LIBRARIES(main ${PHYSX_LIBS} pthread dl)

INSTALL(TARGETS main DESTINATION .)

ProfMobius

04-08-2007 05:01:19

Hi there. I'm new on the forum but have been using Ogre for a few months.
I'm really interresting in using the PhysX engine and NxOgre for my current project, but i have a problem with compilation.
I'm using the last version of PhysX for Linux (2.7.2) and the latest svn version of NxOgre (33).

When i tried to compile using the Code::Block workspace given in the svn, i first had some problems with friend classes error (only needed to add the missing class keyword between friend and the class name, can't remember the exact location of the error, i will post it here later), and now i have another error in NxOgreCooking.cpp line 620.
heightFieldDesc.samples = new NxU32[width * width];
Code::Block complainerror: expression in new-declarator must have integral or enumeration type

Does anyone have a clue on what i need to do to achieve compilation ? or else, a precompiled version of the library ? A binary for x86 would be just fine. If you are willing to help me, just send me the library to my mailbox :)

Thank in advance and cheers.

betajaen

04-08-2007 09:16:06

Intresting find.

"width" is a floating point which your compiler is concerned that the contents could contain a decimal point; You can't have 12.5, 0.4 or -293.21 length arrays.

If you change the line to:

heightFieldDesc.samples = new NxU32[heightFieldDesc.nbRows * heightFieldDesc.nbColumns];

It should work. I wonder why Visual Studio didn't pick up on it.

ProfMobius

04-08-2007 13:22:13

Work like a charm, thx you :)
Ok, now, next batch of errors :
NxOgreTrigger.h (line 135)
class NxExport Trigger : public Actor {

friend Scene;
friend SceneTriggerController;


error: a class-key must be used when declaring a friend
error: friend declaration doest not name a class or function


Solution :

class NxExport Trigger : public Actor {

friend class Scene;
friend class SceneTriggerController;


You have many of thoses along the way.

NxOgreTrigger.h -> lines 135, 136
NxOgreForceField.h -> lines 127,230,231
NxOgreCharacter.h -> line 32
NxOgreTrigger.h -> lines 135,136

After those modifications, it compile, but i don't have a clue yet if it will run normally or not, i will come back to tell

ProfMobius

04-08-2007 14:00:52

Also found out that the workspace is not up to date, you have missing files, not included files and some library name changes. Working on sorting this out right now :)

ProfMobius

04-08-2007 14:14:29

Everything compile and link perfectly as long as i don't include NxOgreCloth.cpp
When i include this file, i have a type mismatch
nxogre3/NxOgre/source/NxOgreCloth.cpp:733: error: no matching function for call to ‘NxPhysicsSDK::createClothMesh(MemoryReadBuffer)’
NxPhysicsSDK.h:544: note: candidates are: virtual NxClothMesh* NxPhysicsSDK::createClothMesh(NxStream&)


Well, as i have read somewhere that the cloths are not working under linux, so it is not a top priority stuff. I will first check if my library link correctly with a sample code and see if other stuffs are working nicely.
Anyway, thanks for the help, and if you want my new project file and a complete list of the modifications i have made, just tell me.

vinvin

04-08-2007 14:46:10

Cloth were not working with PhysX 2.6.2, now there is 2.7.2 and it is supposed to be working.

By the way, I don't have modified this file and I don't have this error. But I'm still with version 28.

ProfMobius

04-08-2007 14:54:49

Hi Vinvin,
I'm still figthing with version 33. Can you send me the binaries for version 28 ? and there is anyway to get the version 28 from the svn ?
I have many linkage errors with not find references on version 33.

Anyway, getting the binary library for a x86 and the headers for version 28 would be just fine for me, as i just want to test the library (for now) and i'm starting to get a bit bored after 2 days of figthing to compile it :p

vinvin

04-08-2007 15:09:38

Yes subversion can give you version 28. I guess you are using tortoise, in the checkout dialog you can specify version. Else with command line svn, -r 28.

There are lots of modifications to make in NxOgre to make it compile under linux. This is how it works, two days, and you get something which still doesn't not work ;) I gave betajaen fixes, but some were not included.

I could not ever have it working for now, there is still a problem with Character support, which is not in PhysX linux release. I will MP you for the .a or .so file.

Roht

18-08-2007 13:48:47

After few hours of fighting with NxOgre uder linux, I have a nice looking lib. Ofcourse any modification written in this thread not exists in sources... and the thread looks a little... death?
The problem is:


Program received signal SIGSEGV, Segmentation fault.
0xb3c51fdf in ?? () from /usr/lib/PhysX/v2.7.2/libPhysXCore.so


With only:

mWorld = new World("log: html");


all is ok, but when I try


mScene = mWorld->createScene("Main", mSceneMgr, "gravity: yes, floor: yes");


segfault appear. Any suggestions?

And, at the end, a little question. I know, that Win version is probably most important for NxOgre developer (anyway, thx betajaen, it's working realy fine under win :) ), but is any hope, to make a real linux distro? Not just 'this can be compile under linux' but a working one?

Regards,
Roht

vinvin

18-08-2007 14:23:05

I already reported the segfault twice. Take a look at http://www.ogre3d.org/phpBB2addons/view ... c&start=30 and http://www.ogre3d.org/phpBB2addons/view ... 7&start=30
It seems that physx is simply not working with linux, or nxogre needs the character library which doesn't exists (I believe) on linux.

Roht

18-08-2007 16:20:41

I saw this, but my question wasn't 'anybody got the same prob' but rather 'anybody do something with this'. Anyway, thx for replay, for now I just will test other libs more deeply, but IMO phisx is the best one, and this is annoying, that not work under linux...

vinvin

21-08-2007 00:58:25

I found an answer on the Ageia's forum.
If NX_DISABLE_FLUIDS is defined, PhysX does not segfault at init. There is no more explaination, but it seems to be ok for everybody.
I succeded to run the Cake example with this (without keyboard and mouse).

betajaen

21-08-2007 09:24:13

Intresting. Any chance have you got your efforts documented so NxOgre can be compiled for Linux without hacking it to bits?

vinvin

21-08-2007 17:40:20

I've already reported what should be done to compile NxOgre under linux.
However, I couldn't still fix the segfault in our game and run it one time with NxOgre under linux.

I've updated NxOgre to HEAD revision (we were working with 28 until now), and there is a new fix for NxOgreContainer.h:397
std::transform(key.begin(),key.end(),key.begin(),tolower);
I could only make it compile replacing the transform by a for loop because tolower needs a cast or something, I don't exactly know what.

Old fixes are :
NxCreateControllerManager and NxReleaseControllerManager don't exists, I did comment them out.
There are lots of 'class' missing between the friend keyword and classnames.

heightFieldDesc.samples = new NxU32[heightFieldDesc.nbRows * heightFieldDesc.nbColumns];
instead of width * width which is double and not int in NxOgreCooking.cpp.

A typo in NxOgre.h :
-#include "NxOgreClothRayCaster.h"
+#include "NxOgreClothRaycaster.h"

And in NxOgreStable.h
-#include "nxversionnumber.h"
+#include "NxVersionNumber.h"

betajaen

21-08-2007 18:50:34

I've done your fixes, some of them were already in such as the friend class and the double/int thing in heightfield.

I'll investigate the tolower thing. The Ogre::StringUtil has a tolower function, I shall "borrow" my ideas from that.

vinvin

22-08-2007 23:21:42

Finally, I'm not able to run any NxOgre app with version 33, the PhysX but reappeared, I don't know why, the NX_DISABLE_FLUIDS trick does not works with this version...
So we're still blocked with NxOgre on linux.

betajaen

23-08-2007 00:12:32

Try this, in NxOgreStable.h before any pieces of code, just have the initial ifndef/define bit, add the following:

#define NX_USE_FLUID_API 0

Compile. If it fails, comment out any #define references after that line when it moans about NX_USE_FLUIDS_API being already defined.

dpb

30-08-2007 17:10:32

I'm using debian etch, and have the following messages when I try to compile. Must be missing something simple.

-------------- Build: Debug in NxOgre ---------------
Compiling: ../source/NxOgreActor.cpp
In file included from /home/benjamin/NxOgre/nxogre3/NxOgre/source/NxOgreActor.cpp:20:
../include/NxOgreStable.h:87:29: error: NxVersionNumber.h: No such file or directory
../include/NxOgreStable.h:142:1: warning: "NX_USE_FORCEFIELD_API" redefined
../include/NxOgreStable.h:135:1: warning: this is the location of the previous definition
../include/NxOgreStable.h:161:16: error: Nx.h: No such file or directory
../include/NxOgreStable.h:162:23: error: NxPhysics.h: No such file or directory
../include/NxOgreStable.h:163:31: error: ControllerManager.h: No such file or directory
In file included from /home/benjamin/NxOgre/nxogre3/NxOgre/source/NxOgreActor.cpp:25:
../include/NxOgreHelpers.h:24:24: error: NxExtended.h: No such file or directory../include/NxOgrePrerequisites.h:158: error: ‘NxU32’ does not name a type
../include/NxOgrePrerequisites.h:159: error: ‘NxU32’ does not name a type
../include/NxOgrePrerequisites.h:160: error: ‘NxU32’ does not name a type
../include/NxOgrePrerequisites.h:161: error: ‘NxU32’ does not name a type
../include/NxOgrePrerequisites.h:235: error: ‘NxActorGroup’ was not declared in this scope
../include/NxOgrePrerequisites.h:235: error: template argument 1 is invalid
../include/NxOgrePrerequisites.h:235: error: invalid type in declaration before ‘;’ token
../include/NxOgrePrerequisites.h:237: error: ‘NxShapeIndex’ was not declared in this scope
../include/NxOgrePrerequisites.h:237: error: template argument 1 is invalid
../include/NxOgrePrerequisites.h:237: error: invalid type in declaration before ‘;’ token
../include/NxOgrePrerequisites.h:238: error: ‘NxShapeIndex’ was not declared in this scope
../include/NxOgrePrerequisites.h:238: error: template argument 1 is invalid
../include/NxOgrePrerequisites.h:238: error: invalid type in declaration before ‘;’ token
../include/NxOgrePrerequisites.h:249: error: ‘NxErrorIndex’ was not declared in this scope
../include/NxOgrePrerequisites.h:249: error: template argument 1 is invalid
../include/NxOgrePrerequisites.h:249: error: invalid type in declaration before ‘;’ token
../include/NxOgrePrerequisites.h:258: error: ‘NxMaterialIndex’ was not declared in this
scope
../include/NxOgrePrerequisites.h:258: error: template argument 1 is invalid
../include/NxOgrePrerequisites.h:258: error: invalid type in declaration before ‘;’ token
../include/NxOgrePrerequisites.h:259: error: ‘NxMaterialIndex’ was not declared in this
scope
../include/NxOgrePrerequisites.h:259: error: template argument 2 is invalid
../include/NxOgrePrerequisites.h:259: error: invalid type in declaration before ‘;’ token
../include/NxOgrePrerequisites.h:263: error: ‘NxCollisionGroup’ was not declared in this scope
../include/NxOgrePrerequisites.h:263: error: template argument 1 is invalid
../include/NxOgrePrerequisites.h:263: error: invalid type in declaration before ‘;’ token
../include/NxOgrePrerequisites.h:307: error: ‘NxVec3’ does not name a type
../include/NxOgreContainer.h:116: error: ‘NxU32’ does not name a type
../include/NxOgreContainer.h: In member function ‘void NxOgre::List<TT>::dumpToConsole()’:
../include/NxOgreContainer.h:332: error: ‘NxU32’ was not declared in this scope
../include/NxOgreContainer.h:332: error: expected `;' before ‘i’
../include/NxOgreContainer.h:334: error: ‘i’ was not declared in this scope
../include/NxOgreContainer.h: At global scope:
../include/NxOgreContainer.h:483: error: ‘NxU32’ does not name a type
../include/NxOgreParams.h:47: error: ‘NxMaterialIndex’ has not been declared
../include/NxOgreParams.h:47: error: ‘bool NxOgre::Params::Set(const NxOgre::NxString&,
std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int&)’ cannot be overloaded
../include/NxOgreParams.h:45: error: with ‘bool NxOgre::Params::Set(const NxOgre::NxString&, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int&)’
../include/NxOgreParams.h:49: error: ‘NxReal’ has not been declared
../include/NxOgreParams.h:49: error: ‘bool NxOgre::Params::Set(const NxOgre::NxString&,
std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int&)’ cannot be overloaded
../include/NxOgreParams.h:45: error: with ‘bool NxOgre::Params::Set(const NxOgre::NxString&, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int&)’
../include/NxOgreParams.h:50: error: ‘NxVec3’ has not been declared
../include/NxOgreParams.h:50: error: ‘bool NxOgre::Params::Set(const NxOgre::NxString&,
std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int&)’ cannot be overloaded
../include/NxOgreParams.h:45: error: with ‘bool NxOgre::Params::Set(const NxOgre::NxString&, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int&)’
../include/NxOgreParams.h:51: error: ‘NxQuat’ has not been declared
../include/NxOgreParams.h:51: error: ‘bool NxOgre::Params::Set(const NxOgre::NxString&,
std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int&)’ cannot be overloaded
../include/NxOgreParams.h:45: error: with ‘bool NxOgre::Params::Set(const NxOgre::NxString&, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int&)’
../include/NxOgreParams.h:55: error: ‘NxHeightFieldAxis’ has not been declared
../include/NxOgreParams.h:55: error: ‘bool NxOgre::Params::Set(const NxOgre::NxString&,
std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int&)’ cannot be overloaded
Process terminated with status 1 (0 minutes, 10 seconds)
50 errors, 2 warnings

(codeblocks:4680): Gtk-CRITICAL **: gtk_window_set_modal: assertion `GTK_IS_WINDOW (window)' failed

dpb

30-08-2007 21:25:14

OK, OK, so I got the paths worked out.

The files in NxOgre.CB.Linux.cbp do not match the .o files in ~/NxOgre/nxogre3/NxOgre/compiler/linux/source after the compile, e.g. there are a bunch of files in the cbp file like NxOgreShapeDescription.h, NxOgreShapeDescriptionMesh ... but there are no .cpp files with those names in ~/NxOgre/nxogre3/NxOgre/source. Instead, there are files named NxOgreShapeBlueprint.cpp (and other ShapeBlueprint files) in NxOgre/source but they aren't in the cbp file. So I changed all the Description files to Blueprint. Now it compiles and makes a bunch of .o files in linux/source, but there's no nxOgre.so in lib.

?

dpb

02-09-2007 22:30:39

Well, sorry for wasting space. I got NxOgre 0.9 running under linux.Just changed
a few lines, such as putting the (NxU32*) in two places in NxOgreCooking.cpp:
delete [] (NxU32*)heightFieldDesc.samples;

but otherwise it was just as posted.

Thanks for the code.

betajaen

02-09-2007 22:39:55

Interesting fix there, thankyou.

But what is more interesting that delete [] heightfield.samples requires a casting in Linux.

dpb

03-09-2007 19:40:52

Apparently g++ 4.1.2 is really strict about types, and complained about deleting a void*.

Also, since I'm using physx 2.7.2, there were a few changes to the cbp file, e.g.
there is no NxCharacter library, so delete the line, and PhysXCooking is called NxCooking .

And I couldn't get linux to find the physx libraries no matter how I rewrote the cbp
file, so I just copied them to /usr/lib.

Hope this helps.

reptor

04-11-2007 18:19:02

What is the status of NxOgre on Linux?

I downloaded the 0.9-38 version from svn. I'm working on Debian GNU/Linux. I have AGEIA PhysX 2.7.2 Linux version. I installed the PhysX .deb packages with dpkg -i.

I spotted these problems, but there might be more.

- NxOgre Code::Blocks project settings for Linux expects that the PhysX libraries are in /usr/local/lib, when they are infact installed into /usr/lib, this is guided by the .deb packages provided by AGEIA and I think we should not need to change how the PhysX libraries are installed, or the project settings file, in order to get NxOgre working.

- PhysXCooking library file is infact NxCooking, as told in earlier post.

- NxCharacter library file does not exist in Linux distribution of PhysX, even though the NxOgre Code::Blocks project file thinks it exists.

- There are several errors in the source code of NxOgre which prevents the library from compiling on g++ 4.2.3. I can provide more information about this but not at this stage. I think some of the errors are already told in earlier posts of this thread.

- The Code::Blocks Linux project file is obviously wrong, regarding what files it tries to build. Probably this file has not been updated to correspond the changes made to the collection of the source code files.


Before diving more into sorting the problems out by myself, I wanted to ask here if NxOgre developer(s?) has already sorted out the show-stopping problems on Linux.

I'm willing to help to the best of my abilities. It is essential for the success of NxOgre on Linux that it could be compiled on Linux without having to spend lots of time figuring out all the problems with the project file and in the source code.

betajaen

04-11-2007 18:41:42

I would ignore the code::blocks file, it's like 8 months out of date, and no way the equivalent of the Visual Studio counterpart.

Apart from simple GCC errors, if you can get it working. I'll be more than happy to submit any changes that make it work.

Last time I checked VinVin was working on Linux with NxOgre, perhaps you can PM him and see his progress?

vinvin

04-11-2007 20:45:16

Yes, a lot of things have changed since the version 2.7 of PhysX, and the code::blocks project is probably very out of date. I always used my own makefile.

Character is not supported, or at least it wasn't two month ago, I did not checked again soon.

Some #ifdef need to be added to deactivate it and others features in all files, and except that, it is running. Making the code portable is not an easy trick, because there are often new versions of NxOgre, each including new files or functionnalities, and creating new not-compiling things. The windows code doesn't use the same features, so it's not fully the same code compiled, and linux error are not obviously found. Gcc doesn't make it easy neither, since some code compiling on windows does not on linux.
I did not use a lot of features, but collisions and vehicles are running fine if I remember correctly. I don't really have this code in mind by these times, because we had 3D rendering speed problems on linux.

Maybe the best thing to test is the cake application, if you want to check the library you compiled do actually link and run. Good luck !

Samiljan

14-11-2007 18:14:14

I've managed to build and run NxOgre 38 and cakebox on linux with only a few modifications.

In NxOgreEnumsBlueprint I added the following checks to the code following line 570


StringList EnumsBlueprint::AsNxFluidSimulationMethod() {

StringList l;

#if NX_USE_FLUID_API
if (mEnum & NX_F_SPH)
l.insert(NxString("NX_F_SPH"));

if (mEnum & NX_F_NO_PARTICLE_INTERACTION)
l.insert(NxString("NX_F_NO_PARTICLE_INTERACTION"));

if (mEnum & NX_F_MIXED_MODE)
l.insert(NxString("NX_F_MIXED_MODE"));
#endif

return l;

}

////////////////////////////////////////////////////////////////////////////////////////////////

StringList EnumsBlueprint::AsNxFluidCollisionMethod() {

StringList l;

#if NX_USE_FLUID_API
if (mEnum & NX_F_STATIC)
l.insert(NxString("NX_F_STATIC"));

if (mEnum & NX_F_DYNAMIC)
l.insert(NxString("NX_F_DYNAMIC"));
#endif

return l;

}

////////////////////////////////////////////////////////////////////////////////////////////////

StringList EnumsBlueprint::AsNxFluidFlag() {

StringList l;

#if NX_USE_FLUID_API
if (mEnum & NX_FF_VISUALIZATION)
l.insert(NxString("NX_FF_VISUALIZATION"));

if (mEnum & NX_FF_DISABLE_GRAVITY)
l.insert(NxString("NX_FF_DISABLE_GRAVITY"));

#if NX_SDK_VERSION_NUMBER >= 250
if (mEnum & NX_FF_COLLISION_TWOWAY)
l.insert(NxString("NX_FF_COLLISION_TWOWAY"));
#endif

#if NX_SDK_VERSION_NUMBER >= 250
if (mEnum & NX_FF_ENABLED)
l.insert(NxString("NX_FF_ENABLED"));
#endif

#if NX_SDK_VERSION_NUMBER >= 250
if (mEnum & NX_FF_HARDWARE)
l.insert(NxString("NX_FF_HARDWARE"));
#endif
#endif //NX_USE_FLUID_API

return l;

}


////////////////////////////////////////////////////////////////////////////////////////////////

StringList EnumsBlueprint::AsNxEmitterType() {

StringList l;


if (mEnum & NX_AF_DISABLE_COLLISION)
l.insert(NxString("NX_AF_DISABLE_COLLISION"));

#if NX_USE_FLUID_API
if (mEnum & NX_FE_CONSTANT_PRESSURE)
l.insert(NxString("NX_FE_CONSTANT_PRESSURE"));

if (mEnum & NX_FE_CONSTANT_FLOW_RATE)
l.insert(NxString("NX_FE_CONSTANT_FLOW_RATE"));
#endif

return l;

}

////////////////////////////////////////////////////////////////////////////////////////////////

StringList EnumsBlueprint::AsNxEmitterShape() {

StringList l;

#if NX_USE_FLUID_API
if (mEnum & NX_FE_RECTANGULAR)
l.insert(NxString("NX_FE_RECTANGULAR"));

if (mEnum & NX_FE_ELLIPSE)
l.insert(NxString("NX_FE_ELLIPSE"));
#endif

return l;

}

////////////////////////////////////////////////////////////////////////////////////////////////

StringList EnumsBlueprint::AsNxFluidEmitterFlag() {

StringList l;

#if NX_USE_FLUID_API
if (mEnum & NX_FEF_VISUALIZATION)
l.insert(NxString("NX_FEF_VISUALIZATION"));

#if NX_SDK_VERSION_NUMBER < 250
if (mEnum & NX_FEF_BROKEN_ACTOR_REF)
l.insert(NxString("NX_FEF_BROKEN_ACTOR_REF"));
#endif

#if 0
#if NX_SDK_VERSION_NUMBER >= 250
if (mEnum & NX_FEF_DUMMY1)
l.insert(NxString("NX_FEF_DUMMY1"));
#endif
#endif

#if NX_SDK_VERSION_NUMBER < 260
if (mEnum & NX_FEF_FORCE_ON_ACTOR)
l.insert(NxString("NX_FEF_FORCE_ON_ACTOR"));
#endif

#if NX_SDK_VERSION_NUMBER >= 260
if (mEnum & NX_FEF_FORCE_ON_BODY)
l.insert(NxString("NX_FEF_FORCE_ON_BODY"));
#endif

#if NX_SDK_VERSION_NUMBER < 260
if (mEnum & NX_FEF_ADD_ACTOR_VELOCITY)
l.insert(NxString("NX_FEF_ADD_ACTOR_VELOCITY"));
#endif

#if NX_SDK_VERSION_NUMBER >= 260
if (mEnum & NX_FEF_ADD_BODY_VELOCITY)
l.insert(NxString("NX_FEF_ADD_BODY_VELOCITY"));
#endif

if (mEnum & NX_FEF_ENABLED)
l.insert(NxString("NX_FEF_ENABLED"));
#endif //NX_USE_FLUID_API

return l;

}

This is because when NX_DISABLE_FLUIDS is defined the fluid headers are not included. Another way was to include them in this file, but this way seemed nicer.


In NxOgreShapePrimitives.h : add class after friend on line 32,67,102 and 136

In NxOgreSimpleShape.h, line 74: gcc complains that the class cannot be friend to itself or something like that, i just removed the line.

In NxOgreTrigger.h, line 95: add a "," before CEnterPtr.

With these changes NxOgre compiles, but I had to change one more thing to make cakebox work. I had to move all the inline function bodies from NxOgreHelpers.cpp to NxOgreHelpers.h for it to link correctly. I don't know why, it seems strange.


To build cakebox I only had to change from void main to int main in Cake.h and use a modified betagui 016.

To build I used scons, because I can't write makefiles :P
SConstruct for NxOgre
SConstruct for cakebox


One thing I find strange is that it only compiles when NX_DEBUG is defined. Or, I managed to compile without by removing cloth and softbodies, but cakebox didn't work then, probably because I didn't remove all of it. Any idea why?

And NX_DISABLE_FLUIDS still has to be defined, but they have added character now.

betajaen

14-11-2007 18:39:14

Excellent. I've booked marked this page and I'll have a read a little later.

vinvin

14-11-2007 18:56:19

Oh this is great if they added Character in the linux release !
Code will be easier to maintain, and I suspected that it caused NxOgre to crash in certain circumstances.

reptor

21-11-2007 20:14:27

In NxOgreSimpleShape.h, line 74: gcc complains that the class cannot be friend to itself or something like that, i just removed the line.
I think it should be:

NxOgreSimpleShape.h
74: friend class SimplePlane; --> friend class SimpleShape;

That is what I figured out by looking how other similar places where done. I think there has just happened a copy&paste mistake. Betajaen should probably confirm this as he's the one who actually coded the whole thing.

The other changes you made to the code files seem to be similar to my changes. But I did not touch NxOgreEnumsBlueprint and cakebox (notice, I don't have a working NxOgre yet).

I had to define also NX32 and LINUX if I recall correctly, otherwise there were some errors. I think the process failed at link time last time I tried, due to the Code::Blocks project file being wrong regarding what files should be linked. I try to get back into this now and see if I get it sorted out.

Also now I have PhysX 2.7.3 for Linux and it seems to have the NxCharacter library. I previously had installed 2.7.2 for Linux and it did not have NxCharacter (include files yes, but no lib). See more discussion about this:
http://www.ogre3d.org/phpBB2addons/view ... 3736#33736

I'll try to work more on this.

Samiljan

23-11-2007 17:04:58

I think you're right about SimpleShape, I just didn't look at the other classes :roll: . And yes, I have to define NX32 and LINUX too.

It's not a hard library to compile and link, my scons-script just compiles all .cpp files in source and source/NxuStream2 and links them all into one shared library. Maybe cheating but it works :P

Using an IDE to compile a library seems overkill to me, but I really recommend scons. I've updated the scripts for 2.7.3 (just changed the paths) if anyone needs them. To use the NxOgre-SConstruct, place it in NxOgre/ and run scons from there, then scons install (to uninstall just use scons install -c).
Cakebox is similar, check the scripts, they are not hard to understand.

It's funny that ageia still haven't changed Cooking/Include to Cooking/include :P.

reptor

23-11-2007 19:07:36

I'll check out the scons thing, never used it before.

Felipe

27-11-2007 15:10:44

I compile Nxogre 0.9-38, physx 2.72 in ubuntu linux and give this errors:

-------------- Build: Debug in NxOgre ---------------
Compiling: ../source/NxOgreActor.cpp
In file included from ../include/NxOgreStable.h:168,
from ../source/NxOgreActor.cpp:20:
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/Nx.h:34:4: error: #error custom definition of NX_CALL_CONV for your OS needed!
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/Nx.h:61:3: error: #error PhysX SDK: Platforms pointer size ambiguous. Please define NX32 or Nx64 in the compiler settings!
In file included from /usr/include/PhysX/v2.7.2/SDKs/Foundation/include/Nx.h:246,
from ../include/NxOgreStable.h:168,
from ../source/NxOgreActor.cpp:20:
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxSimpleTypes.h:89:3: error: #error Unknown platform!
In file included from /usr/include/PhysX/v2.7.2/SDKs/Physics/include/NxScene.h:14,
from /usr/include/PhysX/v2.7.2/SDKs/Physics/include/NxPhysics.h:26,
from ../include/NxOgreStable.h:169,
from ../source/NxOgreActor.cpp:20:
/usr/include/PhysX/v2.7.2/SDKs/Physics/include/Nxp.h:111:1: warning: "NX_USE_FLUID_API" redefined
In file included from ../source/NxOgreActor.cpp:20:
../include/NxOgreStable.h:113:1: warning: this is the location of the previous definition
In file included from /usr/include/PhysX/v2.7.2/SDKs/NxCharacter/include/ControllerManager.h:10,
from ../include/NxOgreStable.h:170,
from ../source/NxOgreActor.cpp:20:
/usr/include/PhysX/v2.7.2/SDKs/NxCharacter/include/NxControllerManager.h:93:17: warning: no newline at end of file
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxSimpleTypes.h:97: error: ‘NxI8’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxSimpleTypes.h:98: error: ‘NxU8’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxSimpleTypes.h:99: error: ‘NxI16’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxSimpleTypes.h:100: error: ‘NxU16’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxSimpleTypes.h:101: error: ‘NxI32’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxSimpleTypes.h:102: error: ‘NxU32’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxSimpleTypes.h:103: error: ‘NxI64’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxSimpleTypes.h:104: error: ‘NxU64’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/Nxf.h:20: error: ‘NxF32’ does not name a type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxFoundationSDK.h:92: error: ‘NxU32’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxArray.h: In member function ‘bool NxArray<ElemType, AllocType>::deleteEntry(const ElemType&)’:
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxArray.h:294: error: ‘NxU32’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxArray.h:294: error: expected `;' before ‘s’
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxArray.h:295: error: expected `;' before ‘i’
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxArray.h:295: error: ‘i’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxArray.h:295: error: ‘s’ was not declared in this scope
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h: At global scope:
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:29: error: ‘NxU32’ does not name a type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:31: error: ‘NxU32’ does not name a type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:32: error: ‘NxU32’ does not name a type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:33: error: ‘NxU32’ does not name a type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:34: error: ‘NxU32’ does not name a type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:42: error: ‘NxU32’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:43: error: declaration of ‘operator=’ as non-function
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:43: error: expected ‘;’ before ‘(’ token
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:48: error: expected `;' before ‘inline’
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:48: error: expected type-specifier before ‘Flag’
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:55: error: ‘NxU32’ does not name a type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:63: error: field ‘IntType’ has incomplete type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:63: error: ‘IntType’ declared as an ‘inline’ field
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:65: error: expected type-specifier before ‘IntType’
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:68: error: declaration of ‘operator=’ as non-function
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:68: error: expected ‘;’ before ‘(’ token
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:71: error: ‘NxU32’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:71: error: ‘Flag’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:72: error: ‘NxU32’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:73: error: ‘NxU32’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:74: error: ‘Flag’ does not name a type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:78: error: ‘Mask’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:78: error: ‘Flag’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:79: error: ‘Mask’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:80: error: ‘Mask’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:82: error: ‘Mask’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:96: error: ‘Field’ does not name a type
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:97: error: ‘Shift’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:97: error: ‘Mask’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:97: error: ‘Field’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:98: error: ‘Mask’ has not been declared
/usr/include/PhysX/v2.7.2/SDKs/Foundation/include/NxBitField.h:101: error: ‘NxU32’ has not been declared


help me!

vinvin

27-11-2007 15:16:23

Maybe you could tell anything else... Like what you use to compile or which defined symbols you have...

Read the thread, and define what needs to be, like NX32 and LINUX and some others maybe. Just read the source where the #error is.

You should use PhysX 2.7.3 by the way which has character support.

Felipe

27-11-2007 19:43:03

I compile Ogre using codeblock successfully.
but when I compile nxogre using codeblock give this errors.

vinvin

27-11-2007 20:10:52

just read.
http://www.ogre3d.org/phpBB2addons/view ... 2833#32833

Felipe

29-11-2007 13:32:28

How I define NX32 and LINUX in code::blocks ?

Felipe

01-12-2007 10:43:01

To build cakebox I only had to change from void main to int main in Cake.h and use a modified betagui 016.

To build I used scons, because I can't write makefiles Razz
SConstruct for NxOgre
SConstruct for cakebox


the links of SConstruct for NxOgre and SConstruct for cakebox is off!!

Samiljan

01-12-2007 12:30:32

To build cakebox I only had to change from void main to int main in Cake.h and use a modified betagui 016.

To build I used scons, because I can't write makefiles Razz
SConstruct for NxOgre
SConstruct for cakebox


the links of SConstruct for NxOgre and SConstruct for cakebox is off!!


Oh, sorry! I should probably have used a better host... It's up again, and here's a better mirror:
SConstruct for NxOgre
SConstruct for cakebox

peterpoon

11-12-2007 22:43:42

Before other things, thank you for the job done !!

I succeeded to compile de NxOgre library on Linux with code blocks(revision 38 ), with the modifications given in this thread. However, when I include the library in the linker (in code in blocks) of an Ogre project, I receive this errors when compiling (No specific code with NxOgre is written yet). Can you tell me what is hapening ?


/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::toVector3(NxVec3 const&)'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::toNxExtendedVec3(Ogre::Vector3 const&)'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::Blueprints::EnumsBlueprint::AsNxSceneFlags()'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::Blueprints::EnumsBlueprint::AsNxSoftBodyMeshFlags()'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::Blueprints::EnumsBlueprint::AsNxSoftBodyFlag()'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::NxCreateID(unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::Blueprints::EnumsBlueprint::AsNxForceFieldCoordinates()'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::Blueprints::EnumsBlueprint::AsNxSoftBodyAttachmentFlag()'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::toNxVec3(Ogre::Vector3 const&)'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::toQuaternion(NxQuat const&)'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::toNxQuat(Ogre::Quaternion const&)'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::Blueprints::EnumsBlueprint::AsNxMeshDataFlags()'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::Blueprints::EnumsBlueprint::AsNxSoftBodyVertexFlags()'
/usr/local/lib/libNxOgre.so:: undefined reference to `NxOgre::Blueprints::EnumsBlueprint::AsNxClothFlag()'
:: === Build finished: 14 errors, 0 warnings ===

Nazgul

19-12-2007 23:28:45

I just managed to compile NxOgre using PhysX 2.7.3 although quite a few adaptions were necessary.

Anyway, i was just wondering about the size of the resulting libraries.

282MB when building as static library (.a)
and still 84MB when creating a shared object library (.so)

The whole thing is built with -O2 optimization.

Does that match any of your results?

EDIT:
I'm going for the static aproach, still i get the same missing references as my foreposter.

slanning

24-12-2007 21:39:29

(sorry, this is moved over from another thread)

I don't know if it's useful, but these are the notes that I took while installing NxOgre on Linux.
Most of the things have been mentioned months ago on the forums,
so I wonder if I'm using the right version of the code...

(Note: if you're just trying this, you won't have this installed today;
do the first paragraph of "Step 1" immediately.)

Prereqs

I'm assuming you already have Ogre installed.
For reference, today is 19 Dec 2007, I use Ubuntu
Hardy Heron (which won't be released till next April),
but you probably would have no problem with Gutsy Gibbon
(which has Ogre 1.4.3).

$ pkg-config --modversion OGRE
1.4.5

I have these Ogre packages installed:

libogre-dev 1.4.5-3build1
libogre14 1.4.5-3build1
ogre-doc 1.4.5-3build1
ogre-tools 1.4.5-3build1

I installed other packages, too, including these:
libdevil-dev libdevil1c2 nvidia-cg-toolkit libois-dev libois1
libcegui-mk2-1 libcegui-mk2-dev libcegui-mk2-doc

(And you might want to remove the OIS ones and install
it manually with version 1.0, because the package is
at 0.99rc1.0 and has an API incompatibility.)


Step 1 - install PhysX

First, go to http://www.nxogre.org/ and click Download.
Click on PhysX, and it will say to go the Ageia site:
http://devsupport.ageia.com/ . You have to apply for an account there.
After you get approved (which apparently can take a couple days,
though mine seemed to come back sooner), login and download both
of the following (search for SDK on the website):

SDK for Linux - this link is for version 2.7.3
http://devsupport.ageia.com/ics/support ... leID=66293

SystemSoftware - this link is for 7.11.13 (works for any platform)
http://devsupport.ageia.com/ics/support ... leID=66288

Then install them:


$ export PHYSX_DIR=$HOME/.physx-install
$ mkdir $PHYSX_DIR
$ cp PhysX_7.11.13_SystemSoftware.exe $PHYSX_DIR
$ cp PhysX_2.7.3_SDK_CoreLinux_deb.tar.gz $PHYSX_DIR
$ cd $PHYSX_DIR
$ tar -zxf PhysX_2.7.3_SDK_CoreLinux_deb.tar.gz
$ rm PhysX_2.7.3_SDK_CoreLinux_deb.tar.gz
$ sudo dpkg -i libphysx-doc-2.7.3_8_i386.deb
$ sudo dpkg -i libphysx-common_2.7.3-8_i386.deb
$ sudo dpkg -i libphysx-2.7.3_8_i386.deb
$ sudo dpkg -i libphysx-dev-2.7.3_8_i386.deb
$ sudo dpkg -i libphysx-extras-2.7.3_8_i386.deb


You might want to also put that `export` line in your ~/.bashrc .

Note: to read the documentation, you need either `xchm`
or `gnochm` to read the Windows-style help files.
The docs are in /usr/share/doc/libphysx-2.7.3/*.chm .

If you have any question about where the .deb packages
put things, do this for example:

$ dpkg -c libphysx-common_2.7.3-8_i386.deb

Basically, the includes are under /usr/include/PhysX/
and libs are in /usr/lib/PhysX/v2.7.3/lib/ .

I put this in /etc/ld.so.conf :


/usr/lib/PhysX/v2.7.3/lib


and then ran this:


$ sudo ldconfig


Otherwise you will probably get errors like this
when you run anything:

error while loading shared libraries: libPhysXCore.so.1: cannot open
shared object file: No such file or directory )

To verify minimally that the PhysX is installed correctly,
put this in a file called test.cpp :


// by CoffeeMan,
// http://www.ogre3d.org/phpBB2addons/viewtopic.php?p=28363#28363

#include <NxPhysics.h>
#include <stdio.h>

NxPhysicsSDK *gPhysicsSDK;

int main(int argc, char* argv[])
{
gPhysicsSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION);
printf("gPhysicsSDK == %p\n", gPhysicsSDK);

if (gPhysicsSDK == NULL)
return -1;

gPhysicsSDK->release();
}


and put this in a file called Makefile :


# based on a CMakeLists.txt file by persoontje
# http://www.ogre3d.org/phpBB2addons/viewtopic.php?p=28592#28592

MYAPP = test

PHYSX_INCDIR = /usr/include/PhysX/v2.7.3/SDKs
PHYSX_LIBDIR = /usr/lib/PhysX/v2.7.3

# compiler and linker
CXX = g++
LD = g++

# variables for convenience
DEFINES = -DLINUX
# INCLUDES = -I$(PHYSX_INCDIR)/Cooking/include -I$(PHYSX_INCDIR)/Foundation/include -I$(PHYSX_INCDIR)/NxCharacter/include -I$(PHYSX_INCDIR)/NxExtensions/include -I$(PHYSX_INCDIR)/Physics/include -I$(PHYSX_INCDIR)/Cooking/Include -I$(PHYSX_INCDIR)/PhysXLoader/include
INCLUDES = -I$(PHYSX_INCDIR)/Cooking/include
INCLUDES += -I$(PHYSX_INCDIR)/Foundation/include
INCLUDES += -I$(PHYSX_INCDIR)/NxCharacter/include
INCLUDES += -I$(PHYSX_INCDIR)/NxExtensions/include
INCLUDES += -I$(PHYSX_INCDIR)/Physics/include
INCLUDES += -I$(PHYSX_INCDIR)/Cooking/Include
INCLUDES += -I$(PHYSX_INCDIR)/PhysXLoader/include
CXXFLAGS = $(INCLUDES) $(DEFINES)

# note: for some reason. libPhysXLoader.so was put in /usr/lib
LDFLAGS = -lpthread -ldl -lPhysXLoader -L$(PHYSX_LIBDIR) -lPhysXCore -lNxCharacter -lNxCooking

# compile everything
all:
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(MYAPP) $(MYAPP).cpp


Note: the command for 'all' has actual tabs in front, not spaces.

Now, compile and run it:


$ make
$ ./test
gPhysicsSDK == 0x804a590



Step 2 - install nxOgre

Download NxOgre from the subversion repository


$ svn co http://latest.nxogre.org/nxogre3
$ cd nxogre3/NxOgre/


I had to make the following edits.

include/NxOgreSimpleShape.h line 74
- change "friend class SimplePlane" to SimpleShape

http://www.ogre3d.org/phpBB2addons/view ... 3429#33429
- many changes, see wiki post (except not removing the line
from NxOgreSimpleShape.h)

Samiljan gives some SConstruct files in this post:
http://www.ogre3d.org/phpBB2addons/view ... 4316#34316

Copy the one for NxOgre into the NxOgre directory and build:

$ cp /tmp/SConstruct-nxogre SConstruct
# You might have to install the scons package first.
$ scons
$ sudo scons install

(to uninstall, sudo scons install -c)


Apparently I should've downloaded "cakebox" too,
because there aren't any demos! (In fact, why isn't cake in svn with NxOgre?)


Step 3 - install Cakebox

21 Dec 2007

Download Cakebox.zip from http://get.nxogre.org/Cakebox.zip .
That's from possibly 12 July 2007, and I don't know if it is
available from subversion.

Staring from the nxogre3/NxOgre/ directory,

$ cp /tmp/Cakebox.zip .
$ unzip Cakebox.zip


See again the post from Samiljan:
http://www.ogre3d.org/phpBB2addons/view ... 3429#33429
- change void main to int main in tutorials/compiler/source/Cake.h

copy the cakebox SConstruct file from Samiljan


$ cd tutorials/
$ cp /tmp/SConstruct-cakebox SConstruct


$ scons
...
g++ -o compiler/source/Cake.o -c -w -g -DNX_DEBUG -DNXOGRE_LINUX -DNX_LINUX -DNX32 -DLINUX -DNX_DISABLE_FLUIDS -I/home/slanning/games/ogre/nxogre/NxOgre-svn/include -I/home/slanning/games/ogre/nxogre/NxOgre-svn/include/NxuStream2 -I/usr/include/OGRE -I/usr/include -I/usr/include/PhysX/v2.7.3/SDKs/Cooking/Include -I/usr/include/PhysX/v2.7.3/SDKs/Foundation/include -I/usr/include/PhysX/v2.7.3/SDKs/NxCharacter/include -I/usr/include/PhysX/v2.7.3/SDKs/NxExtensions/include -I/usr/include/PhysX/v2.7.3/SDKs/Physics/include -I/usr/include/PhysX/v2.7.3/SDKs/PhysXLoader/include compiler/source/Cake.cpp
In file included from compiler/source/Cake.h:23,
from compiler/source/Cake.cpp:3:
compiler/source/BetaGUI.h:284: error: extra qualification 'BetaGUI::Window::' on member 'createRealButton'
In file included from compiler/source/Cake.cpp:3:
/home/slanning/games/ogre/nxogre/NxOgre-svn/include/NxOgreWorld.h: In member function 'virtual void Frosting::preStart(NxOgre::World*)':
/home/slanning/games/ogre/nxogre/NxOgre-svn/include/NxOgreWorld.h:218: error: 'NxOgre::Scenes NxOgre::World::mScenes' is protected
compiler/source/Cake.h:951: error: within this context
scons: *** [compiler/source/Cake.o] Error 1
scons: building terminated because of errors.

For the extra qualification error,
- removed Window:: from BetaGUI.h:284.

The protected error, see
http://www.ogre3d.org/phpBB2addons/view ... 8516#28516
- changed to mWorld->getScenes()->get(...)

$ scons
...
g++ -o compiler/source/Cake.o -c -w -g -DNX_DEBUG -DNXOGRE_LINUX -DNX_LINUX -DNX32 -DLINUX -DNX_DISABLE_FLUIDS -I/home/slanning/games/ogre/nxogre/NxOgre-svn/include -I/home/slanning/games/ogre/nxogre/NxOgre-svn/include/NxuStream2 -I/usr/include/OGRE -I/usr/include -I/usr/include/PhysX/v2.7.3/SDKs/Cooking/Include -I/usr/include/PhysX/v2.7.3/SDKs/Foundation/include -I/usr/include/PhysX/v2.7.3/SDKs/NxCharacter/include -I/usr/include/PhysX/v2.7.3/SDKs/NxExtensions/include -I/usr/include/PhysX/v2.7.3/SDKs/Physics/include -I/usr/include/PhysX/v2.7.3/SDKs/PhysXLoader/include compiler/source/Cake.cpp
scons: *** Source `compiler/source/BetaGui.cpp' not found, needed by target `compiler/source/BetaGui.o'. Stop.

It seems the methods are implemented in BetaGui.h itself,
so edited SConstruct line 23:
sourcefiles = ["compiler/source/Cake.cpp", "compiler/source/BetaGui.cpp"]
- removed BetaGui.cpp

$ scons
...
g++ -o cakebox compiler/source/Cake.o -L/home/slanning/games/ogre/nxogre/NxOgre-svn -L/usr/lib -L/usr/lib/PhysX/v2.7.3 -lOgreMain -lPhysXLoader -lNxCooking -lNxCharacter -lNxOgre -lOIS
/home/slanning/games/ogre/nxogre/NxOgre-svn/libNxOgre.so: undefined reference to `NxOgre::toVector3(NxVec3 const&)'
/home/slanning/games/ogre/nxogre/NxOgre-svn/libNxOgre.so: undefined reference to `NxOgre::toNxExtendedVec3(Ogre::Vector3 const&)'
/home/slanning/games/ogre/nxogre/NxOgre-svn/libNxOgre.so: undefined reference to `NxOgre::NxCreateID(unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/home/slanning/games/ogre/nxogre/NxOgre-svn/libNxOgre.so: undefined reference to `NxOgre::toNxVec3(Ogre::Vector3 const&)'
/home/slanning/games/ogre/nxogre/NxOgre-svn/libNxOgre.so: undefined reference to `NxOgre::toQuaternion(NxQuat const&)'
/home/slanning/games/ogre/nxogre/NxOgre-svn/libNxOgre.so: undefined reference to `NxOgre::toNxQuat(Ogre::Quaternion const&)'
collect2: ld returned 1 exit status
scons: *** [cakebox] Error 1

Same error as reported at
http://www.ogre3d.org/phpBB2addons/view ... 5001#35001
No reply given.

These methods are defined in nxogre/NxOgre-svn/source/NxOgreHelpers.cpp .
Ah, I overlooked a comment from (as usual) Samiljan in
http://www.ogre3d.org/phpBB2addons/view ... 3429#33429

With these changes NxOgre compiles, but I had to change one more thing to
make cakebox work. I had to move all the inline function bodies from
NxOgreHelpers.cpp to NxOgreHelpers.h for it to link correctly. I don't know
why, it seems strange.


Actually to me it seems normal; they are *inline*.
So I did as Samiljan said and moved them from .cpp to .h,
then went back up to the NxOgre-svn directory,

$ scons
$ sudo scons install
$ cd tutorials/
$ scons

And it compiled. (No install target, that's okay.)
Try it:

$ ./cakebox
...
Added resource location 'Media/Env/' of type 'FileSystem' to resource group 'General'
Loading library RenderSystem_GL
OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library RenderSystem_GL. System Error: RenderSystem_GL.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)
Done and Done..

Hmm.. I guess it doesn't find my RenderSystem_GL,
so I did this (on Ubuntu - otherwise make it point to your plugins.cfg):

$ ln -s /etc/OGRE/plugins.cfg

Didn't work.
(NB: I tried `export OGRE_HOME=/usr/lib/OGRE`, but it didn't work either.)
Okay, brute force approach:

$ sudo gedit /etc/ld.so.conf # actually I used emacs

Add this line (or wherever your RenderSystem_GL.so is found):
/usr/lib/OGRE

$ sudo ldconfig

Same error, wtf?

Ah... in compiler/source/Cake.h, it does

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

Unf... Finally, brute force it even more:

$ ln -s /usr/lib/OGRE/RenderSystem_GL.so
(again wherever your RenderSystem_GL.so is installed)

$ ./cakebox
...
Loading library Plugin_ParticleFX
OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library Plugin_ParticleFX. System Error: Plugin_ParticleFX.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)
Done and Done..

Gah gah gah gah!

$ rm RenderSystem_GL.so


$ for f in /usr/lib/OGRE/*.so; do ln -s $f; done


$ ./cakebox
...
Loading library Plugin_CgProgramManager
OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library Plugin_CgProgramManager. System Error: Plugin_CgProgramManager.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)
Done and Done..

Nooooo... Okay, I see this is in Cake.h too:

mRoot->loadPlugin("RenderSystem_GL");
mRoot->loadPlugin("Plugin_ParticleFX");
mRoot->loadPlugin("Plugin_OctreeSceneManager");
mRoot->loadPlugin("Plugin_CgProgramManager");

Actually these are what Ubuntu (Hardy Heron, at least, Ogre 1.4.5)
has in /etc/OGRE/plugins.cfg :

Plugin=RenderSystem_GL.so
Plugin=Plugin_ParticleFX.so
Plugin=Plugin_BSPSceneManager.so
Plugin=Plugin_OctreeSceneManager.so
Plugin=Plugin_EXRCodec.so

(and thus in /usr/lib/OGRE/ ).
And in my locally installed version of Ogre ($HOME/.ogre-install/lib/OGRE/)
I actually have Plugin_CgProgramManager.so, but I don't want to bother
recompiling/linking NxOgre against that (and updating the SConstruct
files), so I just commented out that loadPlugin line and rebuilt cakebox:


$ gedit compiler/source/Cake.h
- comment out Plugin_CgProgramManager line


$ scons
$ ./cakebox
...
Plugin successfully installed
Render Device = 'Direct3D9 Rendering Subsystem'
Segmentation fault (core dumped)

OMG...

#ifdef WIN32
mRenderConfiguration["device"] = "Direct3D9";
#else
mRenderConfiguration["device"] = "OpenGL";
#endif

I don't see how that's possible, considering the rest of Cake.h compiled
even with the Direct3d renderer stuff, heh. But I tracked it down finally
to the file config.yaml:

# Graphics
device:direct3d9
width:1024
height:768
depth:32
aa:0
vsync:Yes
fullscreen:No

which is called from getConfig(). Moving this away caused an error,
so I edited it manually:


$ gedit media/config.yaml

# Graphics
device:opengl
width:1024
height:768
depth:32
aa:0
vsync:Yes
fullscreen:No


Got a window to come up this time, but:

$ ./cakebox
...
Parsing scripts for resource group Autodetect
Finished parsing scripts for resource group Autodetect
Parsing scripts for resource group Bootstrap
Finished parsing scripts for resource group Bootstrap
Parsing scripts for resource group General
Finished parsing scripts for resource group General
Parsing scripts for resource group Internal
Finished parsing scripts for resource group Internal
OGRE EXCEPTION(5:ItemIdentityException): Unable to derive resource group for nx.floor.mesh automatically since the resource was not found. in ResourceGroupManager::findGroupContainingResource at OgreResourceGroupManager.cpp (line 1368)
Done and Done..

nx.floor.mesh is in media/Env.
Ah, the directory name is lower case, but media/resources.cfg
is pointing to uppercase directories... Edited it:


$ gedit media/resources.cfg
# Resource locations to be added to the 'boostrap' path
# This also contains the minimum you need to use the Ogre example framework
[Bootstrap]
FileSystem=media/Essential/Boot/

# Resource locations to be added to the default path
[General]
FileSystem=media/
FileSystem=media/Essential/
FileSystem=media/Essential/BetaGUI/
FileSystem=media/Essential/BetaGUIExtended/
FileSystem=media/Essential/Fonts/
FileSystem=media/SimpleMeshes/
FileSystem=media/ComplexMeshes/
FileSystem=media/Env/


$ ./cakebox


A scene with a yellow cube!

For info:

NxOgre (NxOgre 0.9-38.Debug) Started, working with:
- PhysX => 2.7.3
- Ogre => 1.4.5 'Eihort'
- Platform => Linux Debug

(final Linux tip: because OIS isn't getting properly destroyed
I think (maybe destroyInputObject should be in the
InputHandler destructor because I'm not sure if InputHandler::stop
gets called when you exit?), the XWindow "repeat" gets/stays unset,
so keys no longer repeat when you hold them down after exiting
the application; this fixes it: xset r rate 300 30
(thanks akem in #ogre3d))

And how to use it:
http://www.ogre3d.org/phpBB2addons/view ... 7846#27846

Cool! (really I think that's awesome)

(But Linux support needs to be better, though,
because people won't do all that work to install something.
*Normal* people... :} )

slanning

24-12-2007 21:42:48


282MB when building as static library (.a)
and still 84MB when creating a shared object library (.so)
(....)
Does that match any of your results?


Yes,

$ ls -l /usr/lib/libNxOgre.so
-rwxrwxr-x 1 root root 73494036 2007-12-21 22:32 /usr/lib/libNxOgre.so

Nazgul

25-12-2007 08:03:41

thanks slanning!
I took another approach with getting nxOgre to work though, since i prefer to include rarely used libs directly with my sources.
This meant:
1. i reshuffled the nxOgre directory-layout for me a bit (.h and .cpp) in one Directory to enable my IDE to do header/implementation switchens.
2. create a qmake projectfile (i like qmake for its good itegration with KDevelop)
3. Bunch of Edits although a few more than in the post you mentioned (more #ifdefs, friend ClassName with friend class ClassName replacing and so on, you name it)

The above mentioned Linker-Errors got fixed when i defined NX32 (should have RTFMed)
I noticed the keyboard repeat stopping but could not quite trace its source - good to know *g*


Regarding the size of the Library: if you do a Releasebuild or do not want debugging information stripping the library significantly reduces its size. (Could have thought of that earlyer)

$ strip libnxogre.a
$ strip libnxogre.so


Sizedifference:

-rw-r--r-- 1 user group 282M 20. Dez 22:35 libnxogre.a
-rw-r--r-- 1 user group 1,7M 20. Dez 04:46 libnxogre.a-stripped


A merry christmas for you all.

EDIT:
Since i had some spare time this night, i took the liberty to patch and pack Cake+NxOgre for linux.
get it here: http://rapidshare.com/files/79109282/ca ... r.bz2.html

Building / Running:

$ tar xjvf cake-linux.tar.bz2
$ cd cake
cake$ qmake
cake$ make
cake$ bin/cake


Cake is pretty vanilla, except the main() stuff and the ogre configuration (use plugins.cfg)

Gemuetlich

26-02-2008 23:02:48

Hi all This is my first post :)

I compiled the libNxOgre.so library in linux
but I got many (more than 50) linking errors like:

/fun/NxOgre/lib/libNxOgre.so: undefined reference to `NxOgre::FixedJoint::FixedJoint(NxOgre::Actor*, NxOgre::Actor*, NxOgre::JointParams)

First I fixed the linking errors that reported peterpoon
fixing the NxOgreHelpers.* files as slanning said

EDITED
I have fix many things as Samiljan said.
THANK YOU! :D

I had other errors because I forgot to define NX_DEBUG
in my application.

But now it works!

Thanks all for your documentation to compile in linux
I just add the configure.ac and the source Makefile.am I use.


AC_INIT([NxOgre], [1.0], [])
AC_CONFIG_AUX_DIR([compiler/build])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_LIBTOOL
AC_CONFIG_HEADERS([config.h])

AC_PROG_CXX
AC_PROG_CC

AC_C_CONST
AC_HEADER_STDBOOL
AC_TYPE_SIZE_T

PKG_CHECK_MODULES(OGRE, [OGRE >= 1.2])
AC_SUBST(OGRE_CFLAGS)
AC_SUBST(OGRE_LIBS)

AC_CONFIG_FILES([
Makefile
source/Makefile
])
AC_OUTPUT


lib_LTLIBRARIES = libNxOgre.la
libNxOgre_la_CPPFLAGS= -DNX_DEBUG -DNX32 -DNXOGRE_LINUX -DNX_LINUX -DLINUX -I$(srcdir)/../include -I$(PHYSX_DIR)/SDKs/Cooking/Include -I$(PHYSX_DIR)/SDKs/Foundation/include -I$(PHYSX_DIR)/SDKs/NxCharacter/include -I$(PHYSX_DIR)/SDKs/NxExtensions/include -I$(PHYSX_DIR)/SDKs/Physics/include -I$(PHYSX_DIR)/SDKs/PhysXLoader/include -DNX_DISABLE_FLUIDS $(OGRE_CFLAGS)

libNxOgre_la_SOURCES = NxOgreActorBlueprint.cpp NxOgreParams.cpp NxOgreActor.cpp NxOgrePhysXDriver.cpp NxOgreBody.cpp NxOgrePose.cpp NxOgreCharacterController.cpp NxOgreRaycaster.cpp NxOgreCharacter.cpp NxOgreRemoteDebuggerConnection.cpp NxOgreCharacterHitReport.cpp NxOgreSceneBlueprint.cpp NxOgreCloth.cpp NxOgreSceneContactController.cpp NxOgreClothRaycaster.cpp NxOgreSceneController.cpp NxOgreCompound.cpp NxOgreScene.cpp NxOgreContainer.cpp NxOgreSceneTriggerController.cpp NxOgreCooking.cpp NxOgreSerialiser.cpp NxOgreDebugRenderer.cpp NxOgreShapeBlueprintConvex.cpp NxOgreDominanceGroup.cpp NxOgreShapeBlueprint.cpp NxOgreEnumsBlueprint.cpp NxOgreShapeBlueprintMesh.cpp NxOgreError.cpp NxOgreShapeBlueprintPrimitives.cpp NxOgreFluid.cpp NxOgreShapeBlueprintTerrain.cpp NxOgreFluidMesh.cpp NxOgreShapeBlueprintWheel.cpp NxOgreForceField.cpp NxOgreShapeConvex.cpp NxOgreGlobalFunctions.cpp NxOgreShape.cpp NxOgreGroup.cpp NxOgreShapeMesh.cpp NxOgreHelper.cpp NxOgreShapePrimitives.cpp NxOgreHelpers.cpp NxOgreShapeTerrain.cpp NxOgreIntersection.cpp NxOgreShapeWheel.cpp NxOgreJoint.cpp NxOgreSimpleShape.cpp NxOgreJointSet1.cpp NxOgreSkeleton.cpp NxOgreJointSet2.cpp NxOgreSoftBody.cpp NxOgreJSON.cpp NxOgreStable.cpp NxOgreJSONRead.cpp NxOgreSummary.cpp NxOgreJSONWrite.cpp NxOgreTesting.cpp NxOgreLog.cpp NxOgreTrigger.cpp NxOgreMaterial.cpp NxOgreUserAllocator.cpp NxOgreMeshManager.cpp NxOgreUserStream.cpp NxOgreMotor.cpp NxOgreWorldBlueprint.cpp NxOgreNxSerialiser.cpp NxOgreWorld.cpp

ProfMobius

25-03-2008 17:04:57

Hi everyone.
Following the informations given on this thread, i finally managed to compile NxOgre on linux :) (Thx everyone for the SCon scripts, the debugging, etc).

Now, i have a bad problem with mesh cooking. I first tried with my own application, and get a really bad error. I also tried with Cakebox own convex mesh, and got the same result. In cakebox, this crash happened when i tried to create the default pyramidal convex mesh.


*** glibc detected *** ./cakebox: double free or corruption (!prev): 0x097872f0 ***
======= Backtrace: =========
/lib/libc.so.6[0x60bac1]
/lib/libc.so.6(cfree+0x90)[0x60f0f0]
/lib/libc.so.6(fclose+0x136)[0x5fa3b6]
/usr/lib/libNxOgre.so(_ZN10UserStreamD1Ev+0x39)[0x2991b9]
/usr/lib/libNxOgre.so(_ZN6NxOgre32NxGenerateConvexMeshFromOgreMeshERKSsP7NxScene6NxVec3S1_+0xa0f)[0x2a8101]
/usr/lib/libNxOgre.so(_ZN6NxOgre11ConvexShape23_bindToActorDescriptionEPNS_5ActorEjR7NxArrayIP11NxShapeDesc18NxAllocatorDefaultE+0x286)[0x21600c]
/usr/lib/libNxOgre.so(_ZN6NxOgre5Actor12_createActorEPNS_14ShapeBlueprintERKNS_4PoseENS_11ActorParamsE+0x34c)[0x25faf4]
/usr/lib/libNxOgre.so(_ZN6NxOgre5ActorC2ERKSsPNS_5SceneEPNS_14ShapeBlueprintERKNS_4PoseENS_11ActorParamsE+0xb67)[0x261bf9]
/usr/lib/libNxOgre.so(_ZN6NxOgre4BodyC1ERKSsPNS_5SceneEPNS_14ShapeBlueprintERKNS_4PoseENS_11ActorParamsE+0x5c)[0x2a0b34]
/usr/lib/libNxOgre.so(_ZN6NxOgre5Scene10createBodyERKSsPNS_14ShapeBlueprintERKNS_4PoseENS_11ActorParamsE+0x7d)[0x26a5e7]
./cakebox[0x805fcb1]
./cakebox[0x806121e]
./cakebox[0x8061709]
./cakebox[0x8064aa0]
./cakebox[0x805082d]
./cakebox[0x805087e]
/usr/lib/libOgreMain-1.4.6.so(_ZN4Ogre4Root17_fireFrameStartedERNS_10FrameEventE+0xd5)[0x38a2eb5]
/usr/lib/libOgreMain-1.4.6.so(_ZN4Ogre4Root17_fireFrameStartedEv+0x67)[0x38a34d7]
/usr/lib/libOgreMain-1.4.6.so(_ZN4Ogre4Root14renderOneFrameEv+0x22)[0x38a3512]
/usr/lib/libOgreMain-1.4.6.so(_ZN4Ogre4Root14startRenderingEv+0x41)[0x38a3581]
./cakebox[0x80521f8]
./cakebox[0x8052259]
./cakebox[0x805705f]
/lib/libc.so.6(__libc_start_main+0xe0)[0x5b8390]
./cakebox(__gxx_personality_v0+0x239)[0x804f841]
======= Memory map: ========
00110000-00111000 r-xp 00110000 00:00 0 [vdso]
00111000-00374000 r-xp 00000000 08:06 3288294 /usr/lib/libNxOgre.so
00374000-0037e000 rwxp 00263000 08:06 3288294 /usr/lib/libNxOgre.so
0037e000-00383000 rwxp 0037e000 00:00 0
00383000-003a1000 r-xp 00000000 08:06 3295254 /usr/lib/libOIS-1.2.0.so
003a1000-003a2000 rwxp 0001e000 08:06 3295254 /usr/lib/libOIS-1.2.0.so
003a2000-003be000 r-xp 00000000 08:06 3288688 /usr/lib/libgdk_pixbuf-2.0.so.0.1200.5
003be000-003bf000 rwxp 0001b000 08:06 3288688 /usr/lib/libgdk_pixbuf-2.0.so.0.1200.5
003bf000-003e0000 r-xp 00000000 08:06 3316012 /usr/lib/libjpeg.so.62.0.0
003e0000-003e1000 rwxp 00020000 08:06 3316012 /usr/lib/libjpeg.so.62.0.0
003e1000-003e5000 r-xp 00000000 08:06 3315716 /usr/lib/libXxf86vm.so.1.0.0
003e5000-003e6000 rwxp 00003000 08:06 3315716 /usr/lib/libXxf86vm.so.1.0.0
003e6000-003e8000 rwxp 00000000 00:0f 1015 /dev/zero
003fd000-004c7000 r-xp 00000000 08:06 716019 /lib/libglib-2.0.so.0.1400.6
004c7000-004c8000 rwxp 000ca000 08:06 716019 /lib/libglib-2.0.so.0.1400.6
004c8000-00537000 r-xp 00000000 08:06 3318520 /usr/lib/libGLU.so.1.3.070002
00537000-00538000 rwxp 0006f000 08:06 3318520 /usr/lib/libGLU.so.1.3.070002
00541000-00556000 r-xp 00000000 08:06 1562227 /usr/lib/libILU.so.1.0.0
00556000-00557000 rwxp 00014000 08:06 1562227 /usr/lib/libILU.so.1.0.0
00559000-0055f000 r-xp 00000000 08:06 1562262 /usr/lib/libzzip-0.so.13.0.49
0055f000-00560000 rwxp 00005000 08:06 1562262 /usr/lib/libzzip-0.so.13.0.49
0057f000-0059a000 r-xp 00000000 08:06 716359 /lib/ld-2.7.so
0059a000-0059b000 r-xp 0001a000 08:06 716359 /lib/ld-2.7.so
0059b000-0059c000 rwxp 0001b000 08:06 716359 /lib/ld-2.7.so
005a2000-006f5000 r-xp 00000000 08:06 718028 /lib/libc-2.7.so
006f5000-006f7000 r-xp 00153000 08:06 718028 /lib/libc-2.7.so
006f7000-006f8000 rwxp 00155000 08:06 718028 /lib/libc-2.7.so
006f8000-006fb000 rwxp 006f8000 00:00 0
006fd000-00724000 r-xp 00000000 08:06 718037 /lib/libm-2.7.so
00724000-00725000 r-xp 00026000 08:06 718037 /lib/libm-2.7.so
00725000-00726000 rwxp 00027000 08:06 718037 /lib/libm-2.7.so
00728000-0072b000 r-xp 00000000 08:06 718038 /lib/libdl-2.7.so
0072b000-0072c000 r-xp 00002000 08:06 718038 /lib/libdl-2.7.so
0072c000-0072d000 rwxp 00003000 08:06 718038 /lib/libdl-2.7.so
0072f000-00744000 r-xp 00000000 08:06 718034 /lib/libpthread-2.7.so
Aborted


Anyone have a clue on what's going on ? I first thought it was from my app, but after testing with Cakebox, i'm pretty sure it is a real bug with the cooking process.

It happen using
- PhysX => 2.7.3
- Ogre => 1.4.6 'Eihort'
- Platform => Linux Debug

Cheers.

Promo

05-04-2008 22:37:01

Hello ProfMobius,

I've also encountered the same problem (see here), and I was also hoping that it was something with my own application only... but it appears to be a library bug somewhere :(

I would like to test complex (convex/trianglemesh) shapes using nxogre bleeding, but I can't get it to compile... I hope maybe someone in the linux nxogre community could compile it successfully

It's really too bad if the cooking doesn't work, as I don't feel like going back to development in windows :(

betajaen

05-04-2008 22:45:00

You could always cook the meshes using Flour in Windows, then load them in Linux.

reptor

05-04-2008 22:49:06

Could you people switch to the latest versions of Ogre3D and NxOgre and see what happens.

Ogre3D 1.4.7
NxOgre 1.0'21

It's worth a shot.

Promo

05-04-2008 22:55:38

You could always cook the meshes using Flour in Windows, then load them in Linux.

Yes, I think that is what I'll do next


As for the trying with the latest versions, yes, that's worth a shot for sure, but as I said earlier, I'm having some problems compiling NxOgre bleeding (1.x), I'll look into those problems next week with some C++ expert if possible.

mgoodman

23-05-2008 20:32:09

You don't have to use cooked meshes in 0.9, it will convert them on the fly.

The whole issue with 0.9 and Linux is the on-the-fly cooking... this line works:

Body *myBody = mScene->createBody("robot.mesh",new CubeShape(10,10,10),Vector3(0,100,0), "mass: 10");

But this one does not:

Body *myBody = mScene->createBody("robot.mesh",new ConvexShape("robot.mesh"),Vector3(50,50,100), "mass: 50");

Here's the error:

*** glibc detected *** /home/mloyer/planet2/trunk/code/planet2: double free or corruption (!prev): 0x08af6568 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb6fd5a85]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb6fd94f0]
/lib/tls/i686/cmov/libc.so.6(fclose+0x134)[0xb6fc43e4]
/opt/nxogre/lib/libNxOgre_d.so(_ZN10UserStreamD1Ev+0x39)[0xb7325cd3]
/opt/nxogre/lib/libNxOgre_d.so(_ZN6NxOgre32NxGenerateConvexMeshFromOgreMeshERKSsP7NxScene6NxVec3S1_+0x9eb)[0xb731fc5f]
/opt/nxogre/lib/libNxOgre_d.so(_ZN6NxOgre11ConvexShape23_bindToActorDescriptionEPNS_5ActorEjR7NxArrayIP11NxShapeDesc18NxAllocatorDefaultE+0x286)[0xb7316a42]
/opt/nxogre/lib/libNxOgre_d.so(_ZN6NxOgre5Actor12_createActorEPNS_14ShapeBlueprintERKNS_4PoseENS_11ActorParamsE+0x34c)[0xb7396824]
/opt/nxogre/lib/libNxOgre_d.so(_ZN6NxOgre5ActorC2ERKSsPNS_5SceneEPNS_14ShapeBlueprintERKNS_4PoseENS_11ActorParamsE+0xa2c)[0xb73986b4]
/opt/nxogre/lib/libNxOgre_d.so(_ZN6NxOgre4BodyC1ERKSsPNS_5SceneEPNS_14ShapeBlueprintERKNS_4PoseENS_11ActorParamsE+0x5c)[0xb739dd3a]
/opt/nxogre/lib/libNxOgre_d.so(_ZN6NxOgre5Scene10createBodyERKSsPNS_14ShapeBlueprintERKNS_4PoseENS_11ActorParamsE+0x7d)[0xb735a9df]
/home/mloyer/planet2/trunk/code/planet2[0x806f6fe]
/home/mloyer/planet2/trunk/code/planet2[0x806f90c]
/home/mloyer/planet2/trunk/code/planet2[0x807a2ea]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb6f80450]
/home/mloyer/planet2/trunk/code/planet2(_ZN4Ogre12SceneManager21_applySceneAnimationsEv+0x61)[0x8056111]


Since Bleeding isn't even compiling on Linux, I'd rather get 0.9 to work. So is it possible to pre-cook meshes and load them with 0.9, essentially bypassing the on-the-fly cooking which is failing on Linux?

dpb

28-07-2008 16:08:17

Has anyone ported 1.0.21 to linux? The links to the scons files are broken, so if anyone could post them that would save time, and if anyone has the corrected source of 1.0.21 for linux that would be really appreciated.

Thx

betajaen

28-07-2008 16:58:23

After installing Debian from scratch on my Eee and surviving that. I decided take the plunge and add a third hard-drive to my main computer which now has Ubuntu on it. I'm going to slowly attempt to get Ogre compiled then port NxOgre over, properly this time - with projects and makefiles

Dusk

28-07-2008 22:57:17

I'm going to slowly attempt to get Ogre compiled then port NxOgre over, properly this time - with projects and makefiles

Linux support == great news!
Thanks betajaen, keep up the good work ;)

D.

dpb

29-07-2008 18:32:37

Yes, greatly appreciated.

nargil

29-07-2008 23:47:54

Oh really thx betajaen ! Hopefuly I can delete windows soon :)

dpb

18-09-2008 01:18:57

Need any help converting to linux? I'd be glad to.

jonnys

28-09-2008 21:27:38

So whats the progress on the linux port?