Box2D Forums

It is currently Mon Sep 06, 2010 10:17 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: * Problem Solved - Building Library, TestBed on Mac
PostPosted: Sun Feb 08, 2009 9:28 am 
Offline

Joined: Sun Feb 08, 2009 9:17 am
Posts: 7
I seem to be stuck on how to compile the Box2D engine.
I am running Mac OS 10.5.6, Xcode 3.1.2

I get 182 errors, most saying:
'******' was not declared in this scope

I was able to compile it a couple of days ago, so I don't know what step I am missing.
Any help would be appreciated :P


Last edited by caw4949 on Tue Feb 10, 2009 12:37 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Getting Started: Build the Library
PostPosted: Sun Feb 08, 2009 4:12 pm 
Offline

Joined: Sun Feb 08, 2009 1:57 pm
Posts: 34
I just answered a similar question in:

viewtopic.php?f=5&t=580&p=12448

The problem is a few missing #includes, read the patch to find out where they should be :P.


Top
 Profile  
 
 Post subject: Re: Getting Started: Build the Library
PostPosted: Mon Feb 09, 2009 12:46 am 
Offline

Joined: Sun Feb 08, 2009 9:17 am
Posts: 7
Ok, I read udoprog's post and downloaded the cstring.1.patch file.
I then put it in the directory named Box2D_v2.0.1

I entered this code into terminal:
Code:
patch -p0 < cstring.1.patch


Everything seemed ok so I tried recompiling the Library.
I got the same errors as before.

As a side note:
There is a Makefile in the Box2D directory, I double click and I get this:

Code:
/Physics/Box2D_v2.0.1/Box2D/Makefile ; exit;
: command not found.1/Box2D/Makefile: line 1: box2d_fixed.patch
: command not found.1/Box2D/Makefile: line 2:
: command not found.1/Box2D/Makefile: line 3: all:
/Physics/Box2D_v2.0.1/Box2D/Makefile: line 4: syntax error near unexpected token'`
'Physics/Box2D_v2.0.1/Box2D/Makefile: line 4: `   (cd Contrib/freeglut; make)
logout



Top
 Profile  
 
 Post subject: Re: Getting Started: Build the Library
PostPosted: Mon Feb 09, 2009 3:11 am 
Offline

Joined: Sun Feb 08, 2009 1:57 pm
Posts: 34
Did you try to only compile the library (./Source) or are you looking to get the testbed up and running?


Top
 Profile  
 
 Post subject: Re: Getting Started: Build the Library
PostPosted: Mon Feb 09, 2009 4:37 am 
Offline

Joined: Sun Feb 08, 2009 9:17 am
Posts: 7
I generated the two static files Source/Gen/fixed/libbox2d.a and Source/Gen/float/libbox2d.a

I wanted to get the TestBed runnning also.
I'm not sure how to get this to work. I get nine errors after trying to link with these files.
My ultimate goal was to get HandCircus's iphone port running but that is a whole different problem.


Top
 Profile  
 
 Post subject: Re: Getting Started: Build the Library
PostPosted: Mon Feb 09, 2009 4:40 am 
Offline

Joined: Sun Feb 08, 2009 1:57 pm
Posts: 34
What errors do you get?


Top
 Profile  
 
 Post subject: Re: Getting Started: Build the Library
PostPosted: Mon Feb 09, 2009 1:48 pm 
Offline

Joined: Sun Feb 08, 2009 9:17 am
Posts: 7
Here are the error messages:
Code:
Building target “TestBed” of project “Box2D” with configuration “Debug”

Checking Dependencies

Ld /Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Debug/TestBed normal i386
    cd /Physics/Box2D_v2.0.1/Box2D/Build/Xcode
    setenv MACOSX_DEPLOYMENT_TARGET 10.4

    /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -L/Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Debug -L/Physics/Box2D_v2.0.1/Box2D/Build/Xcode/../../Source/Gen/fixed -L/Physics/Box2D_v2.0.1/Box2D/Build/Xcode/../../Source/Gen/float -F/Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Debug -filelist /Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Box2D.build/Debug/TestBed.build/Objects-normal/i386/TestBed.LinkFileList -mmacosx-version-min=10.4 -framework GLUT -framework OpenGL -lbox2d -o /Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Debug/TestBed

ld warning: b2PairCallback::~b2PairCallback()has different visibility (default) in /Physics/Box2D_v2.0.1/Box2D/Source/Gen/fixed/libbox2d.a(b2World.o) and (hidden) in /Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Box2D.build/Debug/TestBed.build/Objects-normal/i386/BroadPhaseTest.o

ld warning: b2PairCallback::~b2PairCallback()has different visibility (default) in /Physics/Box2D_v2.0.1/Box2D/Source/Gen/fixed/libbox2d.a(b2World.o) and (hidden) in /Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Box2D.build/Debug/TestBed.build/Objects-normal/i386/BroadPhaseTest.o

ld warning: b2Vec2::Length() consthas different visibility (default) in /Physics/Box2D_v2.0.1/Box2D/Source/Gen/fixed/libbox2d.a(b2Distance.o) and (hidden) in /Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Box2D.build/Debug/TestBed.build/Objects-normal/i386/TestEntries.o

ld warning: b2DebugDraw::~b2DebugDraw()has different visibility (default) in /Physics/Box2D_v2.0.1/Box2D/Source/Gen/fixed/libbox2d.a(b2WorldCallbacks.o) and (hidden) in /Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Box2D.build/Debug/TestBed.build/Objects-normal/i386/Render.o

ld warning: b2DebugDraw::~b2DebugDraw()has different visibility (default) in /Physics/Box2D_v2.0.1/Box2D/Source/Gen/fixed/libbox2d.a(b2WorldCallbacks.o) and (hidden) in /Physics/Box2D_v2.0.1/Box2D/Build/Xcode/build/Box2D.build/Debug/TestBed.build/Objects-normal/i386/Render.o

Undefined symbols:
  "b2PrismaticJoint::SetMotorSpeed(float)", referenced from:
      ElasticBody::Step(Settings*)      in TestEntries.o
      ElasticBody::Step(Settings*)      in TestEntries.o
      MotorsAndLimits::Keyboard(unsigned char)in TestEntries.o

  "b2PolygonDef::SetAsBox(float, float, b2Vec2 const&, float)", referenced from:
      ApplyForce::ApplyForce()in TestEntries.o
      ApplyForce::ApplyForce()in TestEntries.o
      ApplyForce::ApplyForce()in TestEntries.o
      ApplyForce::ApplyForce()in TestEntries.o
      BipedTest::BipedTest()in TestEntries.o
      BipedTest::BipedTest()in TestEntries.o
      BipedTest::BipedTest()in TestEntries.o
      BipedTest::BipedTest()in TestEntries.o
      Car::Car()   in TestEntries.o
      Car::Car()   in TestEntries.o
      Car::Car()   in TestEntries.o
      Car::Car()   in TestEntries.o
      CCDTest::CCDTest()in TestEntries.o
      CCDTest::CCDTest()in TestEntries.o
      CCDTest::CCDTest()in TestEntries.o
      CCDTest::CCDTest()in TestEntries.o
      CCDTest::CCDTest()in TestEntries.o
      CCDTest::CCDTest()in TestEntries.o
      CompoundShapes::CompoundShapes()in TestEntries.o
      CompoundShapes::CompoundShapes()in TestEntries.o
      CompoundShapes::CompoundShapes()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ShapeEditing::ShapeEditing()in TestEntries.o
      TheoJansen::TheoJansen()in TestEntries.o
      TheoJansen::TheoJansen()in TestEntries.o
      TimeOfImpact::TimeOfImpact()in TestEntries.o
      VerticalStack::VerticalStack()in TestEntries.o
      VerticalStack::VerticalStack()in TestEntries.o
      ContactCB::ContactCB()in TestEntries.o
      ContactCB::ContactCB()in TestEntries.o

  "b2PulleyJointDef::Initialize(b2Body*, b2Body*, b2Vec2 const&, b2Vec2 const&, b2Vec2 const&, b2Vec2 const&, float)", referenced from:
      Pulleys::Pulleys()in TestEntries.o

  "b2World::Step(float, int)", referenced from:
      Test::Step(Settings*)     in Test.o

  "b2Body::SetXForm(b2Vec2 const&, float)", referenced from:
      DistanceTest::Keyboard(unsigned char)in TestEntries.o
      PolyCollision::Keyboard(unsigned char)in TestEntries.o
      TheoJansen::TheoJansen()in TestEntries.o
      TheoJansen::TheoJansen()in TestEntries.o

  "b2RevoluteJoint::SetMotorSpeed(float)", referenced from:
      Car::Keyboard(unsigned char)in TestEntries.o
      Car::Keyboard(unsigned char)in TestEntries.o
      Car::Keyboard(unsigned char)in TestEntries.o
      TheoJansen::Keyboard(unsigned char)in TestEntries.o
      TheoJansen::Keyboard(unsigned char)in TestEntries.o
      TheoJansen::Keyboard(unsigned char)in TestEntries.o

  "b2RevoluteJoint::SetMaxMotorTorque(float)", referenced from:
      Car::Keyboard(unsigned char)in TestEntries.o
      Car::Keyboard(unsigned char)in TestEntries.o
      Car::Keyboard(unsigned char)in TestEntries.o

  "b2PolygonDef::SetAsBox(float, float)", referenced from:
      Bridge::Bridge()in TestEntries.o
      Bridge::Bridge()in TestEntries.o
      Car::Car()   in TestEntries.o
      Car::Car()   in TestEntries.o
      CCDTest::CCDTest()in TestEntries.o
      Chain::Chain() in TestEntries.o
      Chain::Chain() in TestEntries.o
      CollisionFiltering::CollisionFiltering()in TestEntries.o
      CollisionFiltering::CollisionFiltering()in TestEntries.o
      CollisionFiltering::CollisionFiltering()in TestEntries.o
      CollisionProcessing::CollisionProcessing()in TestEntries.o
      CollisionProcessing::CollisionProcessing()in TestEntries.o
      CollisionProcessing::CollisionProcessing()in TestEntries.o
      CompoundShapes::CompoundShapes()in TestEntries.o
      CompoundShapes::CompoundShapes()in TestEntries.o
      CompoundShapes::CompoundShapes()in TestEntries.o
      DistanceTest::DistanceTest()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      Dominos::Dominos()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      ElasticBody::ElasticBody()in TestEntries.o
      Gears::Gears() in TestEntries.o
      Gears::Gears() in TestEntries.o
      MotorsAndLimits::MotorsAndLimits()in TestEntries.o
      MotorsAndLimits::MotorsAndLimits()in TestEntries.o
      PolyCollision::PolyCollision()in TestEntries.o
      PolyShapes::PolyShapes()in TestEntries.o
      Pulleys::Pulleys()in TestEntries.o
      Pulleys::Pulleys()in TestEntries.o
      Pyramid::Pyramid()in TestEntries.o
      Pyramid::Pyramid()in TestEntries.o
      SensorTest::SensorTest()in TestEntries.o
      ShapeEditing::ShapeEditing()in TestEntries.o
      SliderCrank::SliderCrank()in TestEntries.o
      SliderCrank::SliderCrank()in TestEntries.o
      SliderCrank::SliderCrank()in TestEntries.o
      SliderCrank::SliderCrank()in TestEntries.o
      TheoJansen::TheoJansen()in TestEntries.o
      TheoJansen::TheoJansen()in TestEntries.o
      TimeOfImpact::TimeOfImpact()in TestEntries.o
      VaryingFriction::VaryingFriction()in TestEntries.o
      VaryingFriction::VaryingFriction()in TestEntries.o
      VaryingFriction::VaryingFriction()in TestEntries.o
      VaryingFriction::VaryingFriction()in TestEntries.o
      VaryingFriction::VaryingFriction()in TestEntries.o
      VaryingFriction::VaryingFriction()in TestEntries.o
      VaryingFriction::VaryingFriction()in TestEntries.o
      VaryingRestitution::VaryingRestitution()in TestEntries.o
      VerticalStack::VerticalStack()in TestEntries.o
      Web::Web()   in TestEntries.o
      Web::Web()   in TestEntries.o

  "b2Sweep::GetXForm(b2XForm*, float) const", referenced from:
      TimeOfImpact::Step(Settings*)      in TestEntries.o

ld: symbol(s) not found
collect2: ld returned 1 exit status


Top
 Profile  
 
 Post subject: Problem solved
PostPosted: Tue Feb 10, 2009 12:34 pm 
Offline

Joined: Sun Feb 08, 2009 9:17 am
Posts: 7
I grouped all the .cpp files in the detail view of Xcode and added them to the TestBed and TestBedApp targets.
Problem solved! What a relief, now I can learn how to use Box2D on my mac. Happy days. :P
Thanks udoprog for all your help.

btw I started to learn programming less than two months ago, this may explain my confusion


Top
 Profile  
 
 Post subject: Re: Problem solved
PostPosted: Tue Feb 10, 2009 1:33 pm 
Offline

Joined: Sun Sep 23, 2007 2:35 pm
Posts: 787
caw4949 wrote:
btw I started to learn programming less than two months ago, this may explain my confusion

XCode tends to be spectacularly bad at indicating what the source of problems like these are, so I wouldn't necessarily blame your lack of experience - I've been using XCode for a couple years now, and I still get hung up on stupid stuff like that! (though as you get more familiar with its quirks you start to realize what the likely source of the errors are, and how to fix them - one hint I can give you is that when you get "dump soup" like you got, with just a million things going wrong, it's almost always worthless to poke around the actual files mentioned, because more often than not it's something that wasn't included, or a semicolon that's missing, or something like that)

It's not a great C++ environment, I've got to say, (it's only really set up properly to do Objective C) though alas, it's the only reasonable option on Mac. :(


Top
 Profile  
 
 Post subject: Re: * Problem Solved - Building Library, TestBed on Mac
PostPosted: Wed Feb 11, 2009 2:33 pm 
Offline

Joined: Sun Feb 08, 2009 1:57 pm
Posts: 34
The problem might be that your program is compiled without/with the TARGET_FLOAT32_IS_FIXED and the library with the opposite.

This would make a lot of function signatures unfitting eachother, and the compiler passes them without notice while the linker cannot match.


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Heritrix [Crawler] and 2 guests


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 © 2000, 2002, 2005, 2007 phpBB Group