~btCollisionShape error...

wahmo2

03-02-2011 22:38:47

Hi,

First of all I am using codeblocks 10.05 on windows 7 64bit, with Ogre 1.71 prebuilt SDK and Bullet 2.77.
I have the latest SVN version of OgreBullet. I compiled bullet's libraries and OgreBullet's and set up a project.
Without any OgreBullet headers included, the application runs and shows the blank screen as it should.
When i include:
"OgreBulletRigidBody.h"
or something like that, might be OgreBulletRigidBodyDynamics, and try to run i get 11 errors all related to btCollisionShape and ~btCollisionShape.
I tried compiling OgreBullet against bullet 2.76 (the version it suggests in the tutorial), and got the same error.
What's wrong?

Fish

04-02-2011 15:34:52

Does C::B know where to find your Bullet headers?

- Fish

wahmo2

04-02-2011 16:34:23

Yes, I went to build options and under the Debug and Release search directories I have put:
$(BULLET_HOME)/src
and configured an enviroment variable within codeblocks so $(BULLET_HOME) points to the root bullet directory.
In linker I linked all the libs:
OgreMain, OIS, OgreBulletCollisions.a, OgreBulletDynamics.a, bulletcollision.a, bulletdynamics.a, LinearMath.a, GIMPACTutils.a, ConvexDecomposition.a
And I believe i am using TDM gcc 4.4.1 that comes in the codeblocks + mingw installer package.

dermont

05-02-2011 00:10:54

Maybe try swapping the order of your linker libraries OgreBulletCollisions.a and OgreBulletDynamics.a.

wahmo2

05-02-2011 16:07:13

Tried swapping the libs just now...didn't do anything.
I searched out older versions of Bullet and found 2.64 RC2, so I'm going to try compiling against that.

Fish

05-02-2011 18:28:22

GCC requires libraries to be listed in a certain order, otherwise it'll throw linker errors. Why that's the case is beyond me. I had to experiment quite a bit before I found the link order that works for me:

OgreMain
OgreBulletDynamics
OgreBulletCollisions
BulletDynamics
BulletCollisions
BulletMath
ConvexDecomposition

I also found that GCC can be oddly finicky when it comes to the trailing ".a" (as in OgreBulletDynamics.a) in the linker definition and sometimes the leading "lib" as in (libOgreBulletDynamics). So far I've found that removing the ".a" in the linker declaration gives the best results.

- Fish

wahmo2

05-02-2011 21:46:08

Thanks Fish, seems it was the '.a' at the end causing the problem.
Now I can finally get physics working! :D

Fish

06-02-2011 02:12:30

You're welcome.

- Fish