The featured download of box2d (v2.1.2) doesn't include the b2RopeJoint files so I went to the "changes" page of the download section and found the list of modified/added files pertaining to the b2RopeJoint. That was change r-141 I believe. I made all of the changes/additions that were modified when b2RopeJoint was added, but my program still won't build. I get the following error:
Undefined symbols:
"b2RopeJoint::b2RopeJoint(b2RopeJointDef const*)", referenced from:
b2Joint::Create(b2JointDef const*, b2BlockAllocator*) in libcocos2d libraries.a(b2Joint.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
If I comment out the commented out lines in this section of b2Joint.cpp then it runs as normal:
But obviously, commenting that out means I can't use b2RopeJoint.
I'm baffled and have been scouring the net for 2 weeks trying to figure this out. Any help would be greatly appreciated.
Thanks
Undefined symbols:
"b2RopeJoint::b2RopeJoint(b2RopeJointDef const*)", referenced from:
b2Joint::Create(b2JointDef const*, b2BlockAllocator*) in libcocos2d libraries.a(b2Joint.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
If I comment out the commented out lines in this section of b2Joint.cpp then it runs as normal:
Code:
b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator)
{
b2Joint* joint = NULL;
switch (def->type)
{
case e_distanceJoint:
{
void* mem = allocator->Allocate(sizeof(b2DistanceJoint));
joint = new (mem) b2DistanceJoint((b2DistanceJointDef*)def);
}
break;
case e_mouseJoint:
{
void* mem = allocator->Allocate(sizeof(b2MouseJoint));
joint = new (mem) b2MouseJoint((b2MouseJointDef*)def);
}
break;
case e_prismaticJoint:
{
void* mem = allocator->Allocate(sizeof(b2PrismaticJoint));
joint = new (mem) b2PrismaticJoint((b2PrismaticJointDef*)def);
}
break;
case e_revoluteJoint:
{
void* mem = allocator->Allocate(sizeof(b2RevoluteJoint));
joint = new (mem) b2RevoluteJoint((b2RevoluteJointDef*)def);
}
break;
case e_pulleyJoint:
{
void* mem = allocator->Allocate(sizeof(b2PulleyJoint));
joint = new (mem) b2PulleyJoint((b2PulleyJointDef*)def);
}
break;
case e_gearJoint:
{
void* mem = allocator->Allocate(sizeof(b2GearJoint));
joint = new (mem) b2GearJoint((b2GearJointDef*)def);
}
break;
case e_lineJoint:
{
void* mem = allocator->Allocate(sizeof(b2LineJoint));
joint = new (mem) b2LineJoint((b2LineJointDef*)def);
}
break;
case e_weldJoint:
{
void* mem = allocator->Allocate(sizeof(b2WeldJoint));
joint = new (mem) b2WeldJoint((b2WeldJointDef*)def);
}
break;
case e_frictionJoint:
{
void* mem = allocator->Allocate(sizeof(b2FrictionJoint));
joint = new (mem) b2FrictionJoint((b2FrictionJointDef*)def);
}
break;
// case e_ropeJoint:
// {
// void* mem = allocator->Allocate(sizeof(b2RopeJoint));
// joint = new (mem) b2RopeJoint((b2RopeJointDef*)def);
// }
// break;
default:
b2Assert(false);
break;
}
return joint;
}
{
b2Joint* joint = NULL;
switch (def->type)
{
case e_distanceJoint:
{
void* mem = allocator->Allocate(sizeof(b2DistanceJoint));
joint = new (mem) b2DistanceJoint((b2DistanceJointDef*)def);
}
break;
case e_mouseJoint:
{
void* mem = allocator->Allocate(sizeof(b2MouseJoint));
joint = new (mem) b2MouseJoint((b2MouseJointDef*)def);
}
break;
case e_prismaticJoint:
{
void* mem = allocator->Allocate(sizeof(b2PrismaticJoint));
joint = new (mem) b2PrismaticJoint((b2PrismaticJointDef*)def);
}
break;
case e_revoluteJoint:
{
void* mem = allocator->Allocate(sizeof(b2RevoluteJoint));
joint = new (mem) b2RevoluteJoint((b2RevoluteJointDef*)def);
}
break;
case e_pulleyJoint:
{
void* mem = allocator->Allocate(sizeof(b2PulleyJoint));
joint = new (mem) b2PulleyJoint((b2PulleyJointDef*)def);
}
break;
case e_gearJoint:
{
void* mem = allocator->Allocate(sizeof(b2GearJoint));
joint = new (mem) b2GearJoint((b2GearJointDef*)def);
}
break;
case e_lineJoint:
{
void* mem = allocator->Allocate(sizeof(b2LineJoint));
joint = new (mem) b2LineJoint((b2LineJointDef*)def);
}
break;
case e_weldJoint:
{
void* mem = allocator->Allocate(sizeof(b2WeldJoint));
joint = new (mem) b2WeldJoint((b2WeldJointDef*)def);
}
break;
case e_frictionJoint:
{
void* mem = allocator->Allocate(sizeof(b2FrictionJoint));
joint = new (mem) b2FrictionJoint((b2FrictionJointDef*)def);
}
break;
// case e_ropeJoint:
// {
// void* mem = allocator->Allocate(sizeof(b2RopeJoint));
// joint = new (mem) b2RopeJoint((b2RopeJointDef*)def);
// }
// break;
default:
b2Assert(false);
break;
}
return joint;
}
But obviously, commenting that out means I can't use b2RopeJoint.
I'm baffled and have been scouring the net for 2 weeks trying to figure this out. Any help would be greatly appreciated.
Thanks