- First, download 'cocos2d-iphone-x.0.tar.gz' , and Open a Finder window and navigate to where you downloaded the Cocos2D source.
- Open the folder and navigate to external\Box2d\Box2D.
- Open a second Finder window, navigate to your project, and navi-
gate to libs.
- Copy the Box2D folder to the libs folder.
- Adding the Box2D directory to your Xcode project
- You have to set "User Header Search Paths" as 'Project_Name
- And also you have to add two more files :
the ones responsible for drawing Box2D objects to the screen for debug purposes.
- After that #import "Box2D.h", what ever file you want and mack sure rename the file with a '.mm' extension. Because you are importing the Box2D header file (which uses C++) in files that are set up to use only Objective-C. To instruct the compiler to allow both C++ and Objective-C, we can add '.mm' extension.