[solved] undefined reference, what am I forgetting ?

Post Reply
nicoo
Posts: 7
Joined: Wed Apr 01, 2015 4:07 pm

[solved] undefined reference, what am I forgetting ?

Post by nicoo »

Hi,

I have this error :

Code: Select all

undefined reference to « btStaticPlaneShape::btStaticPlaneShape(btVector3 const&, float) »
this is my command to compile :

Code: Select all

g++ main.cc  -lBulletDynamics -lLinearMath -lBulletSoftBody -lBulletCollision -I/usr/include/bullet
It seems I forget a lib, but I don't know wich is it...
Last edited by nicoo on Sun Apr 05, 2015 8:49 pm, edited 1 time in total.
anthrax11
Posts: 72
Joined: Wed Feb 24, 2010 9:49 pm

Re: undefined reference, what am I forgetting ?

Post by anthrax11 »

Is it possible that you compiled bullet with double precision, but included bullet headers without defining BT_USE_DOUBLE_PRECISION?
nicoo
Posts: 7
Joined: Wed Apr 01, 2015 4:07 pm

Re: undefined reference, what am I forgetting ?

Post by nicoo »

yes I compiled with double precision settled on,
and I have

Code: Select all

#define BT_USE_DOUBLE_PRECISION 1
in main.cc

there is somewhere some information about the use of double precision, the keyword BT_USE_DOUBLE_PRECISION on wiki returns nothing
anthrax11
Posts: 72
Joined: Wed Feb 24, 2010 9:49 pm

Re: undefined reference, what am I forgetting ?

Post by anthrax11 »

The btStaticPlaneShape constructor looks like this:

Code: Select all

btStaticPlaneShape(const btVector3 &planeNormal, btScalar planeConstant);
btScalar is defined as a double if BT_USE_DOUBLE_PRECISION is defined and as a float otherwise. The flag has no effect unless defined before #including the bullet headers, so make sure you do that in main.cc.
nicoo
Posts: 7
Joined: Wed Apr 01, 2015 4:07 pm

Re: undefined reference, what am I forgetting ?

Post by nicoo »

ok, thank you I moved the define. Now that works
Post Reply