[ODE] Linker errors
Chris Engels
chris.engels at agc.fhg.de
Thu Jun 26 02:57:01 2003
I am trying to create an ODE world completely within a class, but I am
getting linker errors whenever I try to declare static objects:
PhysicsComponent.obj : error LNK2001: unresolved external symbol
"public: static struct dxSpace * PhysicsComponent::space"
(?space@PhysicsComponent@@2PAUdxSpace@@A)
PhysicsComponent.obj : error LNK2001: unresolved external symbol
"public: static struct dxWorld * PhysicsComponent::world"
(?world@PhysicsComponent@@2PAUdxWorld@@A)
etc.
If I remove static, I get the following errors when I call
dJointCreateContact() in the nearCallBack:
error C2597: illegal reference to non-static member
'PhysicsComponent::world'
error C2597: illegal reference to non-static member
'PhysicsComponent::contacts'
I tried explicitly defining the scope of the objects to be within the
class, but it made no difference. All of the sample programs seem to
declare the objects globally or only within a single function, which
aren't really options for me. Does anybody know what I am doing wrong or
how to fix this?
Thanks,
Chris