Getting started

krux
Posts: 11
Joined: Tue Apr 06, 2010 7:25 pm

Getting started

Post by krux »

Hi

I want to make my first steps in using bullet. I downloaded the source, and installed in my Linux file system. I did nothing more than linking the static library, and included <btBulletDynamicsCommon.h>. I didn't even write a single line ob Bullet code, and this is what the compiler gave to me.

Code: Select all

g++ -Wl,-rpath,/home/arne/qtsdk-2010.02/qt/lib -o BulletUebung main.o -L/home/arne/qtsdk-2010.02/qt/lib -lSDL -lGL -lGLU -lLinearMath -lBulletCollision -lBulletDynamics -lQtGui -L/home/arne/qtsdk-2010.02/qt/lib -L/usr/X11R6/lib -lQtCore -lpthread
/usr/local/lib/libBulletDynamics.a(btTypedConstraint.o): In function `btRigidBody::~btRigidBody()':
btTypedConstraint.cpp:(.text._ZN11btRigidBodyD1Ev[btRigidBody::~btRigidBody()]+0x71): undefined reference to `btCollisionObject::~btCollisionObject()'
btTypedConstraint.cpp:(.text._ZN11btRigidBodyD1Ev[btRigidBody::~btRigidBody()]+0x5b): undefined reference to `btCollisionObject::~btCollisionObject()'
/usr/local/lib/libBulletDynamics.a(btRigidBody.o): In function `btRigidBody::serialize(void*, btSerializer*) const':
btRigidBody.cpp:(.text+0x45d): undefined reference to `btCollisionObject::serialize(void*, btSerializer*) const'
/usr/local/lib/libBulletDynamics.a(btRigidBody.o): In function `btRigidBody::btRigidBody(float, btMotionState*, btCollisionShape*, btVector3 const&)':
btRigidBody.cpp:(.text+0x1c35): undefined reference to `btCollisionObject::btCollisionObject()'
btRigidBody.cpp:(.text+0x1d83): undefined reference to `btCollisionObject::~btCollisionObject()'
/usr/local/lib/libBulletDynamics.a(btRigidBody.o): In function `btRigidBody::btRigidBody(float, btMotionState*, btCollisionShape*, btVector3 const&)':
btRigidBody.cpp:(.text+0x1da5): undefined reference to `btCollisionObject::btCollisionObject()'
btRigidBody.cpp:(.text+0x1ef3): undefined reference to `btCollisionObject::~btCollisionObject()'
/usr/local/lib/libBulletDynamics.a(btRigidBody.o): In function `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)':
btRigidBody.cpp:(.text+0x1f0e): undefined reference to `btCollisionObject::btCollisionObject()'
btRigidBody.cpp:(.text+0x1f67): undefined reference to `btCollisionObject::~btCollisionObject()'
/usr/local/lib/libBulletDynamics.a(btRigidBody.o): In function `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)':
btRigidBody.cpp:(.text+0x1f8e): undefined reference to `btCollisionObject::btCollisionObject()'
btRigidBody.cpp:(.text+0x1fe7): undefined reference to `btCollisionObject::~btCollisionObject()'
/usr/local/lib/libBulletDynamics.a(btRigidBody.o): In function `btRigidBody::~btRigidBody()':
btRigidBody.cpp:(.text._ZN11btRigidBodyD0Ev[btRigidBody::~btRigidBody()]+0x56): undefined reference to `btCollisionObject::~btCollisionObject()'
btRigidBody.cpp:(.text._ZN11btRigidBodyD0Ev[btRigidBody::~btRigidBody()]+0x79): undefined reference to `btCollisionObject::~btCollisionObject()'
/usr/local/lib/libBulletDynamics.a(btRigidBody.o):(.rodata._ZTI11btRigidBody[typeinfo for btRigidBody]+0x8): undefined reference to `typeinfo for btCollisionObject'
collect2: ld returned 1 exit status
I hope you can help me.
Last edited by krux on Tue Apr 06, 2010 10:41 pm, edited 2 times in total.
ndujar
Posts: 7
Joined: Fri Apr 02, 2010 4:31 am
Location: Spain

Re: Getting started

Post by ndujar »

Hi krux!
It seems to me that the linked libraries are misspelled...
In my system all the letters are lowercase (i.e. bulletmath, bulletcollision,...)...and from the error report I see you have the first letter of each word in Capitals...

Hopefully the solution is there!

Regards
krux
Posts: 11
Joined: Tue Apr 06, 2010 7:25 pm

Re: Getting started

Post by krux »

that was not the problem, I am shure, that i spelled everything correctly before I made the post here. I made a complete rebuild of bullet, this time in unix line endings, and with shared libraries on, and with the fix of the makefile listed here in the forum. Now it seems to work.
ndujar
Posts: 7
Joined: Fri Apr 02, 2010 4:31 am
Location: Spain

Re: [solved]Getting started

Post by ndujar »

Hi krux:

Great you fixed it!
Enjoy!
krux
Posts: 11
Joined: Tue Apr 06, 2010 7:25 pm

Re: Getting started

Post by krux »

it is not fixed, i thought, that I fixed it, but the shared library doesn't work, too. Now the problem comes with executing the program.

Code: Select all

arne@arne-laptop:~/QtCreatorProjects/BulletUebung$ ./BulletUebung 
./BulletUebung: error while loading shared libraries: libLinearMath.so.2.76: cannot open shared object file: No such file or directory
here is my /usr/local/lib folder:

Code: Select all

arne@arne-laptop:/usr/local/lib$ ls
libBulletCollision.a        libBulletDynamics.so.2.76  libLinearMath.so
libBulletCollision.so       libBulletSoftBody.a        libLinearMath.so.2.76
libBulletCollision.so.2.76  libBulletSoftBody.so       python2.6
libBulletDynamics.a         libBulletSoftBody.so.2.76  python3.1
libBulletDynamics.so        libLinearMath.a            site_ruby
i already tried to copy the shared libs into the project folder, that doesn't change anything.
User avatar
godlike
Posts: 20
Joined: Fri Feb 19, 2010 7:09 pm

Re: Getting started

Post by godlike »

Try an "ldd BulletUebung" and post the results.

Also try to run it like this:
setenv LD_LIBRARY_PATH /usr/local/lib
./BulletUebung
krux
Posts: 11
Joined: Tue Apr 06, 2010 7:25 pm

Re: Getting started

Post by krux »

thanks godlike, here is "ldd BulletUebung" result.

Code: Select all

        libLinearMath.so.2.76 => not found
        libBulletCollision.so.2.76 => not found
        libBulletDynamics.so.2.76 => not found

setenv LD_LIBRARY_PATH /usr/local/lib
made it. Now I hope that I can finally start to develop with bullet.
User avatar
godlike
Posts: 20
Joined: Fri Feb 19, 2010 7:09 pm

Re: Getting started

Post by godlike »

It looks like /usr/local/lib is an irregular library path. The executables try to load the dynamic libs from /usr/lib unless you override it by setting the LD_LIBRARY_PATH.
krux
Posts: 11
Joined: Tue Apr 06, 2010 7:25 pm

Re: Getting started

Post by krux »

somhow (don't ask why) it does now work without setting the LD_LIBRARY_PATH.