Box2D Forums

It is currently Tue May 21, 2013 5:17 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat May 05, 2012 5:50 am 
Offline

Joined: Sat May 05, 2012 5:46 am
Posts: 8
Hi,

The xcode project fails to build the Testbed & Helloworld projects on Mac 10.7 Lion. The stable build 2.2.1 works just fine. Here is the output:

Undefined symbols for architecture x86_64:
"b2MotorJointDef::Initialize(b2Body*, b2Body*)", referenced from:
MotorJoint::MotorJoint() in TestEntries.o
"b2MotorJoint::SetLinearOffset(b2Vec2 const&)", referenced from:
MotorJoint::Step(Settings*) in TestEntries.o
"b2MotorJoint::SetAngularOffset(float)", referenced from:
MotorJoint::Step(Settings*) in TestEntries.o
"b2MotorJoint::b2MotorJoint(b2MotorJointDef const*)", referenced from:
b2Joint::Create(b2JointDef const*, b2BlockAllocator*) in libBox2D.a(b2Joint.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Can anybody help?

I believe it works ok on Visual Studio 2010.

Thanks in advance,

Kevin.


Top
 Profile  
 
PostPosted: Sat May 05, 2012 6:32 am 
Offline

Joined: Sat May 05, 2012 5:46 am
Posts: 8
Fixed it:

XCode had no knowledge of b2MotorJoint.h/.cpp.

Right-click on Box2D/Dynamics/Joints -> Add files to "Box2D" then navigate to: Box2D/Dynamics/Joints and add the 2 missing files.

Testbed compiles & works fine now.

HTH,

Kevin.


Top
 Profile  
 
PostPosted: Sat May 05, 2012 6:35 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1515
Location: Tokyo
The cmake file is just missing the references to the motor joint which was added recently. In the file CMakeLists.txt in the Box2D/Box2D folder, look for the section:
Code:
set(BOX2D_Joints_SRCS
   Dynamics/Joints/b2DistanceJoint.cpp
   Dynamics/Joints/b2FrictionJoint.cpp
   Dynamics/Joints/b2GearJoint.cpp
   Dynamics/Joints/b2Joint.cpp
   Dynamics/Joints/b2MouseJoint.cpp
   Dynamics/Joints/b2PrismaticJoint.cpp
   Dynamics/Joints/b2PulleyJoint.cpp
   Dynamics/Joints/b2RevoluteJoint.cpp
   Dynamics/Joints/b2RopeJoint.cpp
   Dynamics/Joints/b2WeldJoint.cpp
   Dynamics/Joints/b2WheelJoint.cpp
)

... and add one line at the end like this:
Code:
set(BOX2D_Joints_SRCS
   Dynamics/Joints/b2DistanceJoint.cpp
   Dynamics/Joints/b2FrictionJoint.cpp
   Dynamics/Joints/b2GearJoint.cpp
   Dynamics/Joints/b2Joint.cpp
   Dynamics/Joints/b2MouseJoint.cpp
   Dynamics/Joints/b2PrismaticJoint.cpp
   Dynamics/Joints/b2PulleyJoint.cpp
   Dynamics/Joints/b2RevoluteJoint.cpp
   Dynamics/Joints/b2RopeJoint.cpp
   Dynamics/Joints/b2WeldJoint.cpp
   Dynamics/Joints/b2WheelJoint.cpp
   Dynamics/Joints/b2MotorJoint.cpp
)


EDIT: ok you beat me to it :D I will leave this here anyway for cmake users.


Top
 Profile  
 
PostPosted: Sat May 05, 2012 6:40 am 
Offline

Joined: Sat May 05, 2012 5:46 am
Posts: 8
Seems like there are other files missing from XCode as well:

I had to add to the Tests folder:

ConveyorBelt.h
Mobile.h
MobileBalanced.h
MotorJoint.h


I'm very new to XCode, is there no way to do a 'refresh' so any other files are picked up?

Kevin.


Top
 Profile  
 
PostPosted: Sat May 05, 2012 12:36 pm 
Offline

Joined: Thu Apr 01, 2010 1:42 pm
Posts: 72
Did you checkout the last version ?
On my computer it build fine. (But there is no Testbed file in my usr/local/bin :()


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group