How to import box2d to cocos2dx 2.2

How to import box2d to cocos2dx 2.2
0.0 0


As the title. I just update my game to cocos2dx 2.2 version. But I don’t know how to include the box2d.h. I get the error from Sprite Helper.

Sorry about my english.


I think I missing some parameter when use the
Any one can help me?


Hmm you mean this don’t work?
#include "Box2D/Box2D.h"


#include “Box2D/Box2D.h” now work. It look like missing some reference when create the project.


I have the same problem with you. Have you solved it yet?


I have just solve it. Your problem appear on ios, android or window phone 8?


I have solve it too in windows 8. And I find that the CocosDenshion have a bug in windows 8 if just create a project by, which just copy the HelloWorld project.


Hey guys I have set the path to cocos2dx/external/ in project properties to make Box2d.h directly include as “Box2D\Box2D.h”. But now my code compiles correctly but when it starts linking it throws multiple linking errors like these

Error 774 error LNK2001: unresolved external symbol "public: void __cdecl b2World::Step(float,int,int)" (?Stepb2World@QAAXMHHZ) C:2d-x-2.2.0\cocos2d-x-2.2.0\projects\HungryFish\proj.wp8\GamePlayLayer.obj HungryFish

as if libBox2D.lib hasn’t been included in the project properties. My question is I have created libBox2D.lib but where to include them in my project properties. In order to create that I have included box2d wp8 project present in external/Box2d/proj.wp8 to my project solution but where to give a path may be in linker but its not working any idea?


i am having the same problem in windows phone 8 using using visual studio. any;luck?


I encountered this problem and the fix was simple.

Once you have added the libBox2D project into your VS project right click on your startup project solution and select properties.

This will open a window that shows you the currently referenced projects that your start up project depends on.

Notice that the libBox2D isn’t in this list… Yet.

Click on the Add New Reference but at the bottom of the references window and select your recently added libBox2D solution.

Click okay and hit build.

You should find everything in working order.


@kurisu You know I must login to like your solution cuz it saved my day! Thank you so much!!!

I am quite noob at the in-depth parts of compiling a program, and crush my brain sometimes I encounter errors like this one ^^"