Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Sep 28, 2012 9:38 pm 
Offline

Joined: Fri Sep 28, 2012 9:30 pm
Posts: 6
Hi,

We're trying to link against btBulletWorldImporter on Ubuntu/Linux (works perfectly on Windows, same version of the code) and the linker is reporting a few select undefined references -- which all seem to check-out as present in the .a and .o files (specifically btAngularLimit::set and btBoxShape::btBoxShape). This is version 2.80 of Bullet from the official tarball.

Are any of you aware of issues in this department?

Code:
build/mylib.a(PhysicsEngine.o): In function `physics::PhysicsEngine::createSpringConstraint(btRigidBody&, Situation const&)':
PhysicsEngine.cpp:(.text+0x39dd): undefined reference to `btGeneric6DofSpringConstraint::btGeneric6DofSpringConstraint(btRigidBody&, btTransform const&, bool)'
build/mylib.a(BulletCollisionShapeManager.o): In function `physics::BulletCollisionShapeManager::addBoxShape(Ogre::Vector3 const&)':
BulletCollisionShapeManager.cpp:(.text+0x2c5): undefined reference to `btBoxShape::btBoxShape(btVector3 const&)'
/usr/local/lib/libBulletWorldImporter.a(btBulletWorldImporter.o): In function `btBulletWorldImporter::createBoxShape(btVector3 const&)':
btBulletWorldImporter.cpp:(.text+0x3cdc): undefined reference to `btBoxShape::btBoxShape(btVector3 const&)'
/usr/local/lib/libBulletWorldImporter.a(btBulletWorldImporter.o): In function `btBulletWorldImporter::convertAllObjects(bParse::btBulletFile*)':
btBulletWorldImporter.cpp:(.text+0x8304): undefined reference to `btAngularLimit::set(float, float, float, float, float)'
btBulletWorldImporter.cpp:(.text+0x8e0c): undefined reference to `btAngularLimit::set(float, float, float, float, float)'


We've spent a fair bit of time digging into this, and the usual cause of linker errors in Linux is the ordering of libraries. However, it's not that, and it doesn't seem to be a cyclic dependency either. Bullet's libraries compiled correctly and contain the object files you'd expect, and those in turn contain the functions above...

My only suspicion is that the compilation settings are making the btBulletWorldImporter resolve a different reference... However, the problem is specifically (and only) for the functions above.

Anyway, help is very much appreciated!

Alex


Top
 Profile  
 
PostPosted: Sat Sep 29, 2012 12:15 am 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
Have you tried compiling and linking the regular Bullet 2.80 demos, using any of the available build systems?
Does that work?

It is generally best to simply add the Bullet source code to your own project/build system (and NOT install Bullet system wide in /usr/include etc).
If any Bullet headers/libs are installed system wide, just remove them first.

Thanks,
Erwin


Top
 Profile  
 
PostPosted: Sun Sep 30, 2012 10:01 am 
Offline

Joined: Fri Sep 28, 2012 9:30 pm
Posts: 6
Thanks Erwin.

The sample was indeed built successfully so I went back step by step and made sure everything was installed OK, starting from that known point. I'm still not sure what was the problem -- possibly, as you suggested, an installation problem.

Here's the final bullet.pc file that I have now:
Code:
Name: bullet
Description: Bullet Continuous Collision Detection and Physics Library
Requires:
Version: 2.80
Libs: -L/usr/local/lib -lBulletWorldImporter -lBulletSoftBody -lBulletDynamics -lBulletCollision -lBulletFileLoader -lLinearMath
Cflags:  -I/usr/local/include/bullet


Note for any one else, this is not installed by default even if you select install extras in the cmake options. You have to edit it manually. The order of the libraries is very important :-)

Alex


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], Google [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group