Linker errors when compiling in double precision
Posted: Thu Apr 02, 2015 10:40 am
Hello!
I just downloaded a fresh version of 2.82 BP and I'm trying to get a project to compile on a 64 bit Linux Ubuntu 14.04. I compiled Bullet with the USE_DOUBLE_PRECISION flag enabled and included a
#define BT_USE_DOUBLE_PRECISION 1
line right into the btScalar.h. This solved most of the occuring issues, except for a few that I cannot seem to wrap my head around. They all seem to be similar, so I will focus on one of them.
Here is the error I get when compiling:
I'm calling the btRigidBody constructor when I initialize tempRigidBody. I don't understand why it can't find it. I'm seeing this line in btRigidBody.h:
and it does not depend on BT_USE_DOUBLE_PRECISION.
Another place, where I call the same constructor with a btScalar
results in the same linker error shown above. I am sure that btScalar is of type double though, because when I remobe the BT_USE_DOUBLE_PRECISION definition, the compiler fails at a lot more places. Can anyone help me please? I'm stuck at this point.
Marcell
I just downloaded a fresh version of 2.82 BP and I'm trying to get a project to compile on a 64 bit Linux Ubuntu 14.04. I compiled Bullet with the USE_DOUBLE_PRECISION flag enabled and included a
#define BT_USE_DOUBLE_PRECISION 1
line right into the btScalar.h. This solved most of the occuring issues, except for a few that I cannot seem to wrap my head around. They all seem to be similar, so I will focus on one of them.
Here is the error I get when compiling:
The line of code that causes this is:Joint.cpp:5: error: undefined reference to `btRigidBody::btRigidBody(double, btMotionState*, btCollisionShape*, btVector3 const&)'
Code: Select all
Joint::Joint() : collisionShape(shape), tempRigidBody(1.0, &ms, &collisionShape, inertia), joint(0)
{
init();
}
class Joint
{
btVector3 inertia;
btDefaultMotionState ms;
btBoxShape collisionShape;
btVector3 shape;
btRigidBody tempRigidBody;
}
Code: Select all
btRigidBody( btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0));
Another place, where I call the same constructor with a btScalar
Code: Select all
btScalar mass = 1.0;
rigidBody = new btRigidBody(mass, &motionState, collisionShape, inertia);
Marcell