views:

51

answers:

1
A: 

You need to either provide a default constructor for b2World, or you need to initialize world in the initializer list:

bc_Game::bc_Game() :world(gravity, sleep)
{
}

This would also require gravity and sleep to be pre-constructed though.

PigBen
If I do that though I get multiple undefined references to b2World() and ~b2World
Chris
@Chris -- If you do what? Provide a default constructor? Let me see your code. Both the header and the implementation of b2World.
PigBen
class bc_Game{ public: bc_Game(b2Vec2 grav, bool sleep); private: bool bv_Running; bool bv_fullscreen; bool bv_firstrun; //Box2d variables float box_timestep; int velocityIter; int posIter; b2Vec2 box_gravity; bool box_sleep; b2World box_world;};
Chris
bc_Game::bc_Game(b2Vec2 grav, bool sleep) : box_world(grav, sleep){ box_timestep = 1.f/60.f; velocityIter = 10; posIter = 10; box_gravity.Set(0.f, -10.f); box_sleep = true;}
Chris
I wanted to see the b2World class. And edit it into your question.
PigBen
Edited in, but b2World isn't my class so...
Chris
Also I have to go to sleep now, I'll check in the morning. If you need the rest of b2World download Box2D.
Chris
I'll assume then, that you don't intend to make changes to b2World. What lines are giving you errors?
PigBen
I have errors relating to the deconstrucor on the first { of the class definition, and I get undefined references to the constructor and destructor on the { and } of bc_Game's ctor.
Chris
Case closed: I forgot to build and link the static library
Chris