OgreNewt on Linux

qmech

02-11-2011 12:45:30

Has anyone successfully compiled OgreNewt (and a project with it) on Linux? If so, how?

Even getting to the point where OgreNewt compiled on my system wasn't exactly trivial and that just led me to the "undefined reference" errors that others have posted about for over a year.

To start off, I grabbed OgreNewt from the svn (identifies as 2.1.0):

http://svn.ogre3d.org/svnroot/ogreaddon ... t/newton20

And the latest *compiled* Newton library for linux from the Newton site:

http://www.newtondynamics.com/downloads ... .29.tar.gz

That's version 2.29, though, and is thoroughly incompatible with OgreNewt from the svn.

I then grabbed the latest Newton source:

http://newton-dynamics.googlecode.com/f ... s-2.33.rar

Nicely packed in a rar, showing the love (*cough*) for Linux users right off.

The Newton source from the rar contains several flaws for the 32bit linux version, at least, from paths missing a "project" to unsupported (in gcc 4+) typecasting -- and an undefined _ASSERT. The fixes were relatively straightforward, though (hint static_cast), and I finally managed to get Newton to compile. Note that it identifies itself as 2.31 not 2.33 in Newton.h.

Okay... so finally having a compatible version of Newton, OgreNewt from the svn compiled.

However, trying to compile a blank OgreNewt project results in the aforementioned "undefined reference" errors:


/usr/local/lib/libOgreNewt.so: undefined reference to `CustomKinematicController::CustomKinematicController(NewtonBody const*, dVector const&)'
/usr/local/lib/libOgreNewt.so: undefined reference to `NewtonCustomJoint::operator delete(void*)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomKinematicController::SetPickMode(int)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomUpVector::SetPinDir(dVector const&)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomHinge::EnableLimits(bool)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomHinge::CustomHinge(dMatrix const&, NewtonBody const*, NewtonBody const*)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomHinge::SetLimis(float, float)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomPlayerController::GetPlayerStairHeight() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomKinematicController::SetTargetMatrix(dMatrix const&)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomSlider::CustomSlider(dMatrix const&, NewtonBody const*, NewtonBody const*)'
/usr/local/lib/libOgreNewt.so: undefined reference to `NewtonCustomJoint::GetBody1() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomSlider::SetLimis(float, float)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomSlider::EnableLimits(bool)'
/usr/local/lib/libOgreNewt.so: undefined reference to `NewtonCustomJoint::GetBody0() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomPlayerController::CustomPlayerController(dMatrix const&, NewtonBody const*, float, float)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomHinge::GetJointOmega() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomBallAndSocket::CustomBallAndSocket(dMatrix const&, NewtonBody const*, NewtonBody const*)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomHinge::GetJointAngle() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomHinge::GetPinAxis() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `dgGrammSchmidt(dVector const&)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomPlayerController::GetVelocity(float&, float&, float&) const'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomKinematicController::SetTargetRotation(dQuaternion const&)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomKinematicController::SetMaxLinearFriction(float)'
/usr/local/lib/libOgreNewt.so: undefined reference to `NewtonCustomJoint::operator new(unsigned int)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomKinematicController::SetMaxAngularFriction(float)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomPlayerController::SetVelocity(float, float, float)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomPlayerController::GetSensorShape() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomKinematicController::SetTargetPosit(dVector const&)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomKinematicController::GetTargetMatrix() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomUpVector::CustomUpVector(dVector const&, NewtonBody*)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomPlayerController::GetStairStepShape() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomPlayerController::GetPlayerHeight() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `NewtonCustomJoint::GetJoint() const'
/usr/local/lib/libOgreNewt.so: undefined reference to `dMatrix::dMatrix(dQuaternion const&, dVector const&)'
/usr/local/lib/libOgreNewt.so: undefined reference to `CustomUserBlank::CustomUserBlank(unsigned int, NewtonBody const*, NewtonBody const*)'


The blank OgreNewt project initially complained of multiple missing header files that the OgreNewt installation had not copied to the include directory (specifically OgreNewt_ConvexCast.h, OgreNewt_RayCastVehicle.h, and OgreNewt_stdafx.h). That was easily remedied, though, by copying those 3 header files to the OgreNewt include library to join their brethren.

That's pretty much how I got as far as I did (I wasn't taking notes, so I might've left out something, like adding OgreNewt to configure.ac). But has anyone gotten to the point where it actually works?

KATO2

11-11-2011 03:32:23

Hello, i have OgreNewt with Newton 2.33 compiled in linux. I follow next steps. but i took the notes in spanish. Sorry. If you have problem with the idiom, please reply me.

I - Descargar el ultimo SDK de Newton desde: http://newtondynamics.com/forum/downloads.php

II - Descomprimir el archivo en una carpeta

III - Copiar las carpetas y .h desde newtonSDK/sdk hasta /usr/include/newtonSDK

IV - Copiar los .a y .so desde newtonSDK/sdk hasta /usr/lib

V - Descargar OgreNewt desde el svn.
svn co https://svn.ogre3d.org/svnroot/ogreaddo ... t/newton20

VII - ir al directorio newton20 y ejecutar.
> mkdir build
> cd build
> cmake ..
> make
> sudo make install

Nota: Antes del paso VII abrir el archivo CMakeList.txt y asegurarse que en la sección OgreNewt_LIB_SRCS e INSTALL(FILES se encuentren los .cpp y .h y de RayCastVehicle y ConvexCast respectivamente. de no estar se deben agregar manualmente.