Building on linux - It now builds.

libolt

12-07-2007 00:59:55

I have written a CMake based build system to get OgreBullet buildong on linux. I have been able to get the collisions and dynamics libraries built with some minor alterations to header files related to case sensitivity. Such as: OgreBulletCollisionsPreRequisites.h being included as: OgreBulletCollisionsPrerequisites.h and OIS.h being included as ois.h.

So I've gotten it to build both libraries and moved onto the demos, however here I run into the following error which I don't know how to fix. It's related to the BetaGUI included in OgreBullet.

/home/libolt/builds/ogreaddons/ogrebullet/Demos/Dynamics_Demos/src/../../include/BetaGUI.h:267: error: extra qualification ‘BetaGUI::Window::’ on member ‘createRealButton’
/home/libolt/builds/ogreaddons/ogrebullet/Demos/Dynamics_Demos/src/../../include/OgreBulletListener.h:100: error: extra qualification ‘OgreBulletListener::’ on member ‘initWorld’
/home/libolt/builds/ogreaddons/ogrebullet/Demos/Dynamics_Demos/src/../../include/OgreBulletListener.h:139: error: extra qualification ‘OgreBulletListener::’ on member ‘getBodyUnderCursorUsingBullet’
/home/libolt/builds/ogreaddons/ogrebullet/Demos/Dynamics_Demos/src/../../include/OgreBulletListener.h:140: error: extra qualification ‘OgreBulletListener::’ on member ‘getBodyUnderCursorUsingOgre’
/home/libolt/builds/ogreaddons/ogrebullet/Demos/Dynamics_Demos/src/../include/Constraints_Demo.h:24: error: extra qualification ‘Constraints_Demo::’ on member ‘Constraints_Demo’
/home/libolt/builds/ogreaddons/ogrebullet/Demos/Dynamics_Demos/src/../include/Constraints_Demo.h:29: error: extra qualification ‘Constraints_Demo::’ on member ‘Constraints_Demo’
make[2]: *** [Demos/Dynamics_Demos/src/CMakeFiles/OgreBulletDynamics.dir/Constraints_Demo.o] Error 1
make[1]: *** [Demos/Dynamics_Demos/src/CMakeFiles/OgreBulletDynamics.dir/all] Error 2
make: *** [all] Error 2


Any help is greatly appreciated.

Mike

rti

25-07-2007 00:19:04

Hey. ...
/home/libolt/builds/ogreaddons/ogrebullet/Demos/Dynamics_Demos/src/../../include/BetaGUI.h:267: error: extra qualification ‘BetaGUI::Window::’ on member ‘createRealButton’...

I did not look into the code at all, so i may be completely wrong. But iirc the extra qualification is a ms compiler g++ incompatibility. For the ms compiler it is ok to write something like:

namespace Baz
{
class Foo
{
void Baz::Foo::bar(int param);
}
}

For g++ the code must look like that.

namespace Baz
{
class Foo
{
void bar(int param);
}
}

The second form is ok for the ms compiler too btw, so it is the more portable one.

Hope that helps.
greetings, rti

libolt

26-07-2007 18:25:52

Thanks for the tip. I was able to fix those errors as well as several others that came up. After a few hours of hacking I got everything compiled and running.

The issue I'm running into now is that the OIS keyboard input doesn't appear to be working. The mouse support works buttons and everything. However if I try to throw a box or other shape by pressing the keys listed in the help I get nothing. In the vehicle demo the arrow keys don't work to move the vehicle around.

So later today if I get some free time I will investigate it. Assuming I can get everything working, I'll post a tarball of my progress for others to look at if they want.

Mike

libolt

29-07-2007 01:42:47

Okay,

Ogrebullet now works for me on linux. :D

The issue I had with OIS keyboard input was my own fault, initializing the keyboard input twice. I discovered it because I have one systemw ith OIS 1.1.0 (CVS?) which throws an exception, whereas the ubuntu gutsy OIS package is 1.0 and keeps on chugging.

Anyways, everything builds and as far as I can tell the dynamics demo is working properly. I am able to throw the different spheres, cubes, cones etc and have them react with other objects and the car in the vehicle demo drives.

I have created a tarball with my changes as well as the cmake build system.

Along with the above mentioned issue of extra qualifications that rti pointed out the fix for, I had a couple of issues.

- The most major issue I ran into was that most, if not all of the OgreBullet*.cpp files in Demos/src were binary files that G++ choked on. I had to open each file in VIM, copy the contents out then paste it into a text file and save it with the name of the original file. Then with the changes listed below they compiled.

- There were several includes I had to modify due to linux's case sensitive nature.

- There were several areas in the demo source where I had to append Ogre:: to Vector3. There's probably a cleaner solution to this, but I just wanted to get everything working.

- In OgreBulletApplication.cpp, in the createFrameListener method the code used to initialize OIS was causing the dynamics demo to crash with an X error.

It turned out that the #ifdef for mWindow->getCustomAttribute is unnecessary.

I replaced:


#if defined OIS_WIN32_PLATFORM
mWindow->getCustomAttribute("WINDOW", &windowHnd);
#elif defined OIS_LINUX_PLATFORM
mWindow->getCustomAttribute( "GLXWINDOW", &windowHnd );
#endif


with


mWindow->getCustomAttribute("WINDOW", &windowHnd);


This appears to be valid code for both Windows and Linux.

I believe that's all of the changes I had to make.

As I said before I created a tar ball with my changes to ogrebullet in it. It's not quite as clean as I had hoped for, and I'm still working on some issues with my build environment on my windows system so that the cmake build system works there as well. I have left the current windows project files intact.

However, I did include Bullet 2.54 as this was the easiest way for me to get ogrebullet up and running quickly since I didn't have it installed locally.

It didn't hurt that bullet has it's own cmake build system which I was able to reference from my own to have it build first. :)

I have tested this code on Ubuntu Feisty and Ubuntu Gutsy (currently in development) on amd64 architecture only, thoguh I do plan to test it on my x86 laptop soon.

The cmake version I tested with is 2.4.6, other versions may work as well.

Hopefully Tuan doesn't mind me posting this here. Anyways you can download the archive here:

http://knightlabs.com/ubc/ogrebullet.tar.bz2

If you have any questions or comments let me know. I'm hoping to work on learning bullet/ogrebullet now and putting it to use.

Mike

rti

31-07-2007 22:08:52

It turned out that the #ifdef for mWindow->getCustomAttribute is unnecessary.

I replaced:


#if defined OIS_WIN32_PLATFORM
mWindow->getCustomAttribute("WINDOW", &windowHnd);
#elif defined OIS_LINUX_PLATFORM
mWindow->getCustomAttribute( "GLXWINDOW", &windowHnd );
#endif


with


mWindow->getCustomAttribute("WINDOW", &windowHnd);


This appears to be valid code for both Windows and Linux.


I think this may be depend on ogre's graphics subsystem on linux. This may be SDL (i think it is in your case) and it may be GLX too. Not sure, but maybe the code will fail on ogre using glx now.

Just a guess :)

libolt

31-07-2007 23:58:38

As of Eihort, I believe SDL has been completely removed from Ogre. I know Pjcast (I believe) went in and rewrote the platform manager subsystem to help simplify things across windows/linux/mac etc.

I was able to get things up and running by simply removing the #ifdef code and reducing it to the one single line for both windows and linux. I tested this under linux on a build of OGRE using GLX directly (the Ubuntu Gutsy packaged version) and my own build on Ubuntu Feisty which uses gtk.


The important thing is that now ogrebullet works on linux, at least for me. I haven't heard any feedback on the tar ball I posted a link to.

It would be nice if at the very least the source code fixes could be tested and possibly included in ogrebullet cvs. I still haven't had enough time to play with it under windows using my build system.

Mike

rti

01-08-2007 00:20:36

Ok. Seems i am not that up to date. So: never mind.

greetings, rti