How can I build BOX2D as a static lib for the iPhone?
Hi friends!
I got box2d running on the iPhone, just including all files into my project.
My question is: is it possible to build box2d as a static lib for the iPhone?
I already asked this question on Box2D forums, but not reply. Can you help me? Did anyone try it?
Thanks a lot.
I got box2d running on the iPhone, just including all files into my project.
My question is: is it possible to build box2d as a static lib for the iPhone?
I already asked this question on Box2D forums, but not reply. Can you help me? Did anyone try it?
Thanks a lot.
Create a new static library target and add all the Box2D source files to that instead of your application target. Then include the static library into your main app. That's really all there is to it.
You can also make a separate project for it and include the target in your game project. XCode can build targets across projects. Though you might need to fiddle with header paths then.
You can also make a separate project for it and include the target in your game project. XCode can build targets across projects. Though you might need to fiddle with header paths then.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Skorche Wrote:Create a new static library target and add all the Box2D source files to that instead of your application target. Then include the static library into your main app. That's really all there is to it.
You can also make a separate project for it and include the target in your game project. XCode can build targets across projects. Though you might need to fiddle with header paths then.
Thanks. I thought it was not possible.
BTW, should I add to my project something like -libBox2d?
No, you add the static lib target as a dependency to your app target (so it knows to build it first), and add the static lib from the "products" folder to the list of libraries to link.
You could do it using linker flags as well, but it's usually a PITA in Xcode.
You could do it using linker flags as well, but it's usually a PITA in Xcode.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Xcode 4 Build Failure on iPhone target | SparkyNZ | 2 | 6,006 |
Apr 7, 2011 02:48 AM Last Post: SparkyNZ |
|
| Static libraries... | the_wandering_monster | 6 | 3,616 |
Dec 31, 2009 03:46 PM Last Post: the_wandering_monster |
|
| OpenGL box2d scale factor | lifebythedrop | 4 | 4,919 |
Nov 15, 2009 06:39 AM Last Post: mpcarr |
|
| Static Library | kendric | 9 | 2,936 |
Sep 17, 2009 11:24 AM Last Post: kendric |
|
| How to build my own static lib and link it to iphone game | zwstudio | 7 | 4,159 |
Aug 18, 2008 09:06 AM Last Post: zwstudio |
|

