Compile OgreOde
From Ogre Wiki
Discussion thread in the OgreOde forum
Contents |
Introduction
In the OgreOde forum people are often complaining about the poor documentation on how to compile OgreOde. Reason for me to show you how to do it. This tutorial is for Visual C++ 2005 (8.1). It is a live documentation from 20.01.08, maybe things have changed since then. I will only show you how to set up OgreOde itself. If you want to compile the demos you may need to do similiar steps to get it working.
Preparation
I use the great RBGui for my project, therefor I need to use the current Ogre CVS version, namely Shoggoth. I have fresh CVS and SVN versions of Ogre, OgreOde and ode on my computer. To compile OgreOde you need to copy your ode version to the OgreOde directory.
Open ogreode/scripts/OgreOde_Source.sln. Visual Studio complains that ode_Source.vcproj is missing. Remove it from the projects list in the Solution Explorer and add ogreode/ode/build/vs2005/ode.sln afterwards. Then rightclick OgreOde_Core, click Project Dependencies, mark ode and click OK.
Ogre_Ode Core
Open the Project Properties for OgreOde_Core. Go to Configuration Properties->C++ and edit the include directories. Replace ..\..\..\OgreMain\include by your Ogre version. If you downloaded Ogre and all the addons to the same directory, that would be ..\..\..\..\ogrenew\OgreMain\include. In Configuration Properties->Linker replace the additional Library Directory for ogre by your path. In the case described above that would be ..\..\..\..\ogrenew\lib. In Configuration Properties->Build Events->Post-Build Event remove the command line. This is not necessary because the library will compile anyway, but maybe you want to know where that strange post build error comes from.
Do all this both for the debug and release configuration.
In my current OgreOde version are some errors, I hope they will be removed in time. To compile OgreOde anyway
in ogremovableobject.h change this line:
virtual void visitRenderables(Renderable::Visitor* visitor,
bool debugRenderables = false) = 0;
to
#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR > 4
void visitRenderables(Ogre::Renderable::Visitor* visitor, bool debugRenderables = false) = 0;
#endif
in OgreOdeGeometry.h in the constructor of TriangleMeshGeometry change this line
dGeomTriMeshDataBuildSimple(_data,(const dReal*)_vertices, (int)vertex_count, (int*)_indices, (int)index_count);
to
dGeomTriMeshDataBuildSimple(_data,(const dReal*)_vertices, (int)vertex_count, (dTriIndex*)_indices, (int)index_count);
You should now be able to compile the project OgreOde_Core. Do so.
Prefab and Loader
Open the Project Properties for OgreOde_Prefab. Go to Configuration Properties->C++ and edit the include directories. Replace ..\..\..\..\OgreMain\include by your Ogre version. If you downloaded Ogre and all the addons to the same directory, that would be ..\..\..\..\..\ogrenew\OgreMain\include. Note that you have to add another ..\ because Prefab lies one level higher than Core. Again change the directory for the libs and delete the command line in the post build event as described before.
Steps for Loader are the same. Do not forget to change the settings for the release configuration, too. Now compile prefab and then loader.
Conclusion
Congratulations, you have now a fresh version of OgreOde. Way to go! To use OgreOde in your project, make the include files of the wanted libraries known to it. I recommend to do this per project only, not via the global Visual Studio settings, so you can keep every project separated (imagine version differences, etc.) Your project will also need the ode headers and libs. This is a problem and reason for many questions in the forum, because there already is an old version of ode in the Ogre include directory. I recommend to copy the Ogre includes somewhere else without the ode folder, so you can use the correct version in your project. If the compiler complains that dParamERP is unkown, you surely compile against the wrong version.
Now have fun with this great physics SDK. You may want to continue with the article First steps with OgreODE or have a look at the OgreODE home.
Thats it, feedback, questions and error/mistake reports are welcome and go to this thread or ruben-gerlachREMOVE@webTHIS.de.
written by rewb0rn, January 20, 2008


