I'm mixing C++ with ObjectiveC for a Cocos2d (objective-C) and Box2D (C++) project.
I have the following C++ class:
class ActorListener : public b2ContactListener
{
public :
const b2Body* Owner;
ActorListener(const b2Body* owner);
~ActorListener();
virtual void BeginContact(b2Contact* contact);
virtual void EndContact(b2Contact* contact);
virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold);
virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse);
};
Which I try to initialise with:
(in header)
ActorListener* Listener;
(in mm file)
Listener = new ActorListener(Body);
I get the error:
Undefined symbols for architecture i386:
"vtable for ActorListener", referenced from:
ActorListener::ActorListener(b2Body const*)in ActorListener.o
ActorListener::ActorListener(b2Body const*)in ActorListener.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status