[SOLVED]Chipmunk on OS X
I'm making a pong clone in OpenGL, and to make it a bit more interesting I want to try using chipmunk for physics. But how can I use it on OS X? Most of the Objective-C stuff is all for iPhone. There is target for a static library in the xcode project it gives but that doesn't even compile. Any help?
Thanks.
Thanks.
"It doesn't even compile" is vague. You need to state the problem clearly and thoroughly if you want an answer.
Chipmunk itself compiles fine on OS X, that's where it's developed.
If you are trying to use the Objective-Chipmunk static library, the one packaged with the Chipmunk distribution is iPhone only. Objective-Chipmunk is closed source, but I can compile an OS X static lib if you want. You are actually the first person that has shown any interest in Objective-Chipmunk on OS X.
If you are trying to use the Objective-Chipmunk static library, the one packaged with the Chipmunk distribution is iPhone only. Objective-Chipmunk is closed source, but I can compile an OS X static lib if you want. You are actually the first person that has shown any interest in Objective-Chipmunk on OS X.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
When I first saw this thread, I went and looked at the website. I thought Objective-Chipmunk worked on both, and the website suggests it does since it says you can use it freely "on Mac OS X and in the iPhone Simulator." It also says that it is very useful "particularly on iPhone games", which implies it's good for Mac OS X games too.
Which we know it certainly would be, if it were available.
Which we know it certainly would be, if it were available.
Yes, it's simply a matter of getting the Mac OS X version of the Objective-Chipmunk static lib (which we give away for free). I have an old compiled version sitting around, but nobody ever seemed to want it so I stopped making builds. I can build a more up to date version if you want.
Again, Chipmunk (the C API portion, and not the Objective-C wrapper) should compile fine on any number of systems including OS X. We are selling the Objective-C wrapper for the iPhone to try to fund further Chipmunk development.
Again, Chipmunk (the C API portion, and not the Objective-C wrapper) should compile fine on any number of systems including OS X. We are selling the Objective-C wrapper for the iPhone to try to fund further Chipmunk development.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
I tried compiling the xcode project in the macosx directory, which contained an iphone target and demo intel target (I tried building the latter), and it didn't compile, giving many errors about references to things beginning with cp. I just assumed the Objective-chipmunk was what I should use for os x.
So how do I compile the C api and include it in my application?
Thanks.
So how do I compile the C api and include it in my application?
Thanks.
Ok, I have a mac static library compiled now, libChipmunk.a, can I just put that in my project's frameworks group and use chipmunk?
Also, my application is packaged as a fat binary with 32-bit and 64-bit intel, does this mean I need to compile 32-bit and 64-bit chipmunk?
Also, my application is packaged as a fat binary with 32-bit and 64-bit intel, does this mean I need to compile 32-bit and 64-bit chipmunk?
Yes, you can just add the static library and the folder full of Chipmunk's headers to you project. The Xcode project is set to build fat static libraries already. You should be good to go.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Ok, thanks.
What about headers? My project won't compile because it can't find chipmunk.h, but it does link to libChipmunk.a fine. I tried "chipmunk.h", "Chipmunk.h", "libChipmunk.h", <Chipmunk/chipmunk.h> etc but nothing worked.
EDIT: I figured it out I just needed to put the chipmunk folder in the include directory of the download into my project.
EDIT: I figured it out I just needed to put the chipmunk folder in the include directory of the download into my project.
#include "chipmunk/chipmunk.h"
It must be quotes, and lower case. The brackets <> means that the header is on a system/compiler defined path.
It must be quotes, and lower case. The brackets <> means that the header is on a system/compiler defined path.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Any chance I could get this OS X version of Objective-Chipmunk?
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Thank you VERY MUCH! I'll let you know how my adventures go.

