Chipmunk questions

Member
Posts: 131
Joined: 2010.08
Post: #16
What steps need to be taken in order to make an external library usable, besides adding it to the project folder?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #17
please use thread titles that contain the key words from the question, in this case "library" at the very least.
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #18
I fix that special for you Wink
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #19
I like to use strange titles, as they gather more attention and I get a reply faster.
When you use an external library like Chipmunk, do you do what is described in http://www.rustyrazorblade.com/2008/02/e...-in-xcode/? Does it work?
Code:
Undefined symbols:
  "_cpInitChipmunk", referenced from:
      -[OpenGLView initWithFrame:] in OpenGLView.o
  "_cpBodyNew", referenced from:
      -[Ball2 init2] in Ball2.o
      -[Ball init1] in Ball.o
  "_cpSpaceNew", referenced from:
      -[OpenGLView initWithFrame:] in OpenGLView.o
  "_cpCircleShapeNew", referenced from:
      -[OpenGLView initWithFrame:] in OpenGLView.o
      -[OpenGLView initWithFrame:] in OpenGLView.o
  "_cpBodyUpdatePosition", referenced from:
      -[OpenGLView renderTimerCallback:] in OpenGLView.o
      -[OpenGLView renderTimerCallback:] in OpenGLView.o
  "_cpSpaceAddBody", referenced from:
      -[OpenGLView initWithFrame:] in OpenGLView.o
      -[OpenGLView initWithFrame:] in OpenGLView.o
  "_cpResetShapeIdCounter", referenced from:
      -[OpenGLView initWithFrame:] in OpenGLView.o
  "_cpSpaceAddShape", referenced from:
      -[OpenGLView initWithFrame:] in OpenGLView.o
      -[OpenGLView initWithFrame:] in OpenGLView.o
  "_cpBodyUpdateVelocity", referenced from:
      -[OpenGLView renderTimerCallback:] in OpenGLView.o
      -[OpenGLView renderTimerCallback:] in OpenGLView.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #20
Your peculiar desires don't come ahead of the health of the forum.

You need to add libChipmunk.a to your project.
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #21
Is the way to add external libraries in http://sites.google.com/site/mikescodera...with-xcode correct? I tried it but got 521 errors about compiling Chipmunk files. Also, libChipmunk.a is shown as red. What does it mean?
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #22
When something shows up red in Xcode, it means that it cannot find the file. You can right-click on the file in Xcode and choose Get info, and under the General tab you can see the Full Path:, which will tell you exactly where it's looking, which you will no doubt notice is not correct, since the file shows up red.

There are situations where system frameworks show up red, but that is a separate issue.
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #23
If I have Chipmunk in my project folder, do I not need to add anything to the Header and Library Search Path build configurations?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #24
Xcode usually adds header paths for you when you add folders to a project, but sometimes it makes a mess. If you are having issues, you should try checking the header search paths in your target's settings.

Is this an iPhone project or a Mac project? If it's an iPhone project, there is a script in the Chipmunk distribution that should build a static library and a folder full of headers. In that case, you should just be able to drop the generated folder into your project. You should be able to set up the same folder structure easily to make a Mac version.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #25
Also, if you add a folder, make sure to select "Recursively create groups for any added folders". That way the folder shows up yellow, otherwise it'll show up blue and won't compile.
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #26
Thanks. I got the project to build and run. How to define a Chipmunk space's boundaries, so that it fills the window?
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #27
(Sep 2, 2010 01:04 PM)AnotherJake Wrote:  There are situations where system frameworks show up red, but that is a separate issue.

Curious, as I have that problem, yet my project compiles fine Fail
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #28
Yeah, I know, it's an Xcode bonkers thing. I'm not sure how to fix the red frameworks when dealing with multiple SDKs in the same Xcode project. It seems to work fine even with some being red. With just one SDK, they can be made non-red by opening the Project Info (the blue icon at the top of Groups & Files), then selecting the General tab, then at the bottom changing the "Base SDK for All Configurations".

For iOS 4, I had to set that pop-up to 3.2 first, and then back to 4.0 to get the reds to go away. Like I said, with multiple SDKs for multiple targets, forget it. It builds fine for me, but they stay red. It's hopeless...

[edit] ... which is yet another small reason to use Make instead.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #29
(Sep 2, 2010 03:06 PM)Miglu Wrote:  Thanks. I got the project to build and run. How to define a Chipmunk space's boundaries, so that it fills the window?

Look at what the demos do, they just add line segment shapes around the edge of the screen.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #30
So a space can not be put into the whole view, like an OpenGL view can with glViewport(0, 0, size.width, size.height). What are the window's center's coordinates in the space's coordinates?
Quote this message in a reply
Post Reply