I have a working Xcode project that includes Cocos2d in one of the views. Now I need to add Box2d. I tried to drag the Box2D folder into the libs directory of my cocos2d-2.x-ARC-iOS folder and add to this purpose, but I get this when compiling:
(in b2BroadPhase.cpp)
'Box2D/Collision/b2BroadPhase.h' file not found
I am sure that this is only the first of many errors that I will receive. What step am I missing to compile all the Box2d files compiled in my project?
All box2d files are listed in compilation sources for the purpose of cocos2d-library.
And why is it so hard to do? Why doesn't it work like any other library?
And - do I need to rename every .m in my project to .mm? This is almost impossible, as it is a large xcode project with many files. I'm just trying to use Box2d in one view.
Additional information in response to the response received by LearnCocos2D -
My folder structure (in Finder) looks like this:
Root = MyProject.xcodeproj, MyProject folder, cocos2d-2.x-ARC-iOS folder The cocos2d-2.x-ARC-iOS folder has a libs folder. Inside this folder, I have a Box2D folder, as well as Cocos2d, CocosDenshion, etc.
In Xcode, I have PROJECT (MyProject) AND 2 TARGETS (cocos2d-library, MyProject) There are "header search paths" for PROJECT and TARGETS. Which one did I install? And should it be recursive or not? And when I drag the Box2D folder into Xcode, for what purpose do I set it?
/Users/me/Dropbox/iOS/MyProject. , ? /Users/me/Dropbox/iOS/MyProject/cocos 2d-2.x-ARC-iOS/libs, , .
-/Users/me/Dropbox/iOS/MyProject/cocos2d-2.x-ARC-iOS/libs MyProject TARGET, , Box2D. "cassert", . , , AppDelegate "Objective-C ++ Source", . ...
NSObjCRuntime.h NSZone.h, NSObject ( unqualified-id, name 'NSString' ..). , , Box2d/Cocos2d, UIKit. .