Has anyone managed to integrate Sparrow with Box2D? I've found I can compile Box2D into an app with no problems and I can compile Sparrow into apps with no problems, but I always get missing symbol errors when trying to compile both.
Box2D
(6 posts) (3 voices)-
Posted 1 year ago #
-
make sure you set the file types of files including the box2d.h to "objc & cpp" ..i think that will solve it..
Posted 1 year ago # -
I'd already done that. I'm not quite sure what the problem is, but I think it's a case of how I'm using the files. Has anyone already got this working and have a scaffold for it?
Thanks
Posted 1 year ago # -
I just tried adding Box2D to the Scaffold project, following this tutorial:
http://blog.zincroe.com/2009/05/how-to-add-box2d-to-an-iphone-xcode-project/And it worked! I must admit, though, that all I tested was if I could import "Box2D.h" and still compile.
The trick was to first mark all .m files of the project (in the original scaffold project, it's just "ApplicationDelegate.m", "Game.m" and "main.m") then to hit the Info button and, in the "General" tab, change the file type from "sourcecode.c.objc" to "sourcecode.cpp.objcpp".
Alternatively, I guess you could change the file extensions from ".m" to ".mm".
Does that work for you, too?
Daniel
Posted 1 year ago # -
I had already been doing that and for a while I have been scratching my head and spouting abuse at my MBP. It turned out tho, that although I had specified a path for my Sparrow and Box2D directories (so XCode knew where to look), I needed to actually add the directories to my XCode project in their entirety. Once I did that, it compiled and my missing symbol errors vanished.
Thanks for the efforts, though. Once I've created a simple demo, I plan to write a tutorial about this for FFD Magazine.
Posted 1 year ago # -
Congratulations, great that it works now!
I am looking forward to the tutorial!Daniel
Posted 1 year ago #
Reply
You must log in to post.