Posts Tagged Box2D
Cocos2D and Box2D Compilation Errors
Posted by Chris Danielson in iPhone Development on October 30th, 2010
This is just to help those that have run into a whole slew of linking and other errors when attempting to add the cocos2d and Box2d frameworks directly into your project.
This information is pertinent for:
#define COCOS2D_VERSION 0x00009904
Cocos2d is easy enough to get to compile into your project. Dealing with Box2d is entirely more complicated if you don’t understand how the file inclusions work. Because of the location of the Box2D.h file you’ll quickly find yourself in a nearly endless conundrum of mismapped linking…
Here is how my project is currently setup:

Cocos2D with Box2D Project Groups
As you can see I have created the Box2D and Cocos2D directories as groups.
The actual file system looks like (I created the lib folder):
- Go to Project -> Edit Active Target “myCocos2DProject”
- Select the Build tab.
- Edit XCode Project Settings