Undefined reference from bullet 2.72 to 2.81

Post Reply
Pacha
Posts: 26
Joined: Sat Jun 15, 2013 2:29 am

Undefined reference from bullet 2.72 to 2.81

Post by Pacha »

Hello everyone.

I downloaded some Ogre code I found online with some Character controller and I wanted to check it out, the thing is that I am having some undefined reference problems.

Here are the errors:
make: *** [ogre-bullet-playground] Error 1
undefined reference to `btCapsuleShape::btCapsuleShape(float, float)'
undefined reference to `btRigidBody::btRigidBody(float, btMotionState*, btCollisionShape*, btVector3 const&)'
undefined reference to `btRigidBody::btRigidBody(float, btMotionState*, btCollisionShape*, btVector3 const&)'
undefined reference to `btConvexHullShape::btConvexHullShape(float const*, int, int)'
undefined reference to `btKinematicCharacterController::btKinematicCharacterController(btPairCachingGhostObject*, btConvexShape*, float, int)'
Here are my libraries:
OgreMain
OIS
boost_system
OgreTerrain
BulletDynamics
BulletCollision
LinearMath
What might be the problem? Thank you!
nattydread
Posts: 2
Joined: Fri Jun 28, 2019 12:51 pm

Re: Undefined reference from bullet 2.72 to 2.81

Post by nattydread »

I have this same issue, but not with ogre just with bullet.
I am linking -lBulletDynamics -lBulletCollision -lLinearMath

and I get
undefined reference to `btCapsuleShape::btCapsuleShape(float, float)'

my code is:

p is a glm::vec3,
colShape = new btCapsuleShape(btScalar(p.x), btScalar(p.y));

I also get the same issue with btConeShape.

Do I need to link an extra library?
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Undefined reference from bullet 2.72 to 2.81

Post by drleviathan »

The btCapsuleShape is inside the BulletCollision library. We must conclude the linker is unable to find the library itself.
nattydread
Posts: 2
Joined: Fri Jun 28, 2019 12:51 pm

Re: Undefined reference from bullet 2.72 to 2.81

Post by nattydread »

drleviathan

Thanks for your tip!
Yes the dynamic linking was not working correctly on (ubuntu) linux even though the dynamic libraries were all in place.

If I forced static linking in my makefile with

LIBS=/usr/local/lib/libBulletCollision.a it works.

Thanks so much, I was struggling with this one.
Post Reply