btRigidBody linux

PaloDeQueso
Posts: 17
Joined: Thu Nov 09, 2006 8:50 pm
Location: Middletown, PA

btRigidBody linux

Post by PaloDeQueso »

I'm currently using the latest version of bullet physics in a project mine, or I should say, am trying to use. I have it up and simulating just fine without adding rigid bodies. I finished up some model loading code and tried to create a rigid body. I should note I'm using GNU Linux (Kubuntu Feisty), with kernel version 2.6.20 running g++ with kdeveleop. When I try to create a btRigidBody dynamically as shown in the version 1.x to 2.x migration, I get this compiler error.

Code: Select all

/home/douglas/Code/engine/engine/src/RigidBody.cpp:37: error: invalid use of undefined type ‘struct btRigidBody’
Which doesn't make any sense considering it's a class, not a struct. My only speculation is that this has something to do with the new c-api code. Thanks for your help as always, Douglas.

PS: http://palodequeso.geektyme.org
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Post by Dragonlord »

You forgot to include the header files in your .cpp . If there is no declaration g++ assumes it is a struct and complains about it. Make sure the basic bullet path are included in your build too. Should look something like this:

g++ ... -IBullet

with Bullet being the root of the directory where you placed the bullet sources.
PaloDeQueso
Posts: 17
Joined: Thu Nov 09, 2006 8:50 pm
Location: Middletown, PA

Should have been more specific...

Post by PaloDeQueso »

I am already including
#include <bullet/btBulletDynamicsCommon.h> which it compiles fine with and I am actually using bullet, I just have not added rigid bodies to the simulation.
PaloDeQueso
Posts: 17
Joined: Thu Nov 09, 2006 8:50 pm
Location: Middletown, PA

hmm

Post by PaloDeQueso »

I tried creating a rigid body in another file that has the same includes and it worked, so it's something to do with this specific file. Sorry to waste your time, and thanks for the support.
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Post by Dragonlord »

Maybe you messed up some #ifdefs ( the evilness of c coding :( ).