[SOLVED] Linker error when not creating CollisionShape

OGREHEAD

04-07-2013 11:47:13

I get a linking error which i find strange.

When I just do:

SceneManager1 = Root::getSingleton().getSceneManager( "SceneManager1" );

DebugDrawer *debugDrawer = new DebugDrawer();
debugDrawer->setDrawWireframe( true );
debugDrawer->setDebugMode( DebugDrawer::DBG_MAX_DEBUG_DRAW_MODE );
debugDrawer->setDrawAabb( true );
debugDrawer->setDrawContactPoints( true );
debugDrawer->setDrawFeaturesText( true );

mWorld = new DynamicsWorld( SceneManager1, AxisAlignedBox( Ogre::Vector3( -10000, -10000, -10000 ), Ogre::Vector3( 10000, 10000, 10000 ) ), Ogre::Vector3( 0, 0, 0 ) );
mWorld->setShowDebugShapes( true );
mWorld->setDebugDrawer( debugDrawer );


I get the following linker error

/usr/bin/ld: /usr/local/lib/libBulletDynamics.so: undefined reference to symbol '_ZN12btAxisSweep3C1ERK9btVector3S2_tP22btOverlappingPairCacheb'


But when I then add the followingBoxCollisionShape

BoxCollisionShape *shape1 = new BoxCollisionShape( Ogre::Vector3( 50, 50, 15.5 ) );
OgreBulletDynamics::RigidBody *body1 = new OgreBulletDynamics::RigidBody ( "Box1", mWorld );
body1->setShape (SceneManager1->getSceneNode( "Orb1" ), shape1, 0.6f, 0.6f, 1.0f, SceneManager1->getSceneNode( "Orb1" )->getPosition(), Quaternion( 0, 0, 0, 1 ) );
body1->enableActiveState();


The linker error disappears.

Does this mean I am missing something or doing anything wrong?
Why can I not just create a physics world without objects?
How can the addition of some code suddenly "correct" previous code?

OGREHEAD

05-07-2013 14:16:40

I reinstalled ogrebullet, by getting svn and patch for btcollisionobject i 4 files.

Now ogrebullet does not complain and I can create world only without getting linker errors.

I think I had a bad install and it is better now.