![]() |
|
Box2D added to Cocos2D errors - Printable Version +- iDevGames Forums (http://www.idevgames.com/forums) +-- Forum: Development Zone (/forum-3.html) +--- Forum: Game Programming Fundamentals (/forum-7.html) +--- Thread: Box2D added to Cocos2D errors (/thread-10468.html) |
Box2D added to Cocos2D errors - MDev - Dec 11, 2012 10:54 AM Hello, I've just added box2d to my project and now I have errors that say: "Invalid conversion from 'int' to 'BalloonType' and "Cannot initialize a parameter of typ 'BalloonType' with an lvalue of type 'int'" at the Balloon alloc line. My project is cocos2d v2 made with the Box2d template. I hope this is enough information. Would someone please help me to understand and fix this? Thanks in advance for your help! Code: // .h file:RE: Box2D added to Cocos2D errors - OneSadCookie - Dec 11, 2012 02:26 PM balloonType is not a BalloonType? You haven't really posted enough to diagnose. Is it an mm file? C++ is stricter than C about this kind of thing. RE: Box2D added to Cocos2D errors - MDev - Dec 11, 2012 04:14 PM I got it figured out. I added .mm to ALL all my implementation files and put ./ in the 'User Header Search Path' for the Build Settings. I appreciate your time! RE: Box2D added to Cocos2D errors - OneSadCookie - Dec 12, 2012 12:08 PM Well, that was a big hammer to use :/ RE: Box2D added to Cocos2D errors - bgulanowski - Dec 18, 2012 01:25 PM If you're interested in doing this a different way, I've built Objective-C static frameworks for both Cocos2D and Box2D that avoid having to include all the source in your project. And in the case of the Box2D wrapper (which I adapted from someone else's), all the C++ is hidden so you can include and compile as normal Objective-C, not Objective-C++. All the C++ ivars are declared in the implementation file, not in the headers. Contributions welcome! https://github.com/bgulanowski/CCBox2D |