0

I'm trying out this new thing... It's called conciseness. I've only been reading about it though, so bear with me.

Installed the templates for cocos2d, cocos2d-chipmunk, and cocos2d-box2d and they're showing up in the project window in Xcode. (I understand cocos2d doesn't yet support ARC, which I have enabled.) Trying to build and run a simple Hello World app in any one of the templates results in a "Lexical or Preprocessor Issue - 'FontManager.h' file not found" error. Looked diligently for an answer to that issue and all I got was this, which doesn't end up helping me, but you're welcome to check it out:

cocos2d error

Abandoned cocos2d and went the kobold2d route. Used the installer and that seemed to work fine. I've been able to get projects to build successfully with kobold2d. Problem is, there is next to no literature on it both in print and online.

I thought, "Maybe I should go the cocos3d route instead and just use it for 2D only." Followed this tutorial:

http://www.techipost.com/2011/02/20/installing-cocos3d-for-iphoneipad/

According to everything that's printed out in Terminal during the install process, it should have worked successfully. Unfortunately, I can't get the 3D templates to show up in Xcode.

I'm at my wits' end, here, and I'm thinking about just learning OpenGL and the UIKit over the course of the next, I don't know, year or two?

Is cocos2d even a viable option anymore, post ARC? Thanks any help you can give, guys.

Community
  • 1
  • 1
baptzmoffire
  • 589
  • 2
  • 4
  • 20
  • 99% of what applies to cocos2d also applies to Kobold2D. Only the startup code is different, and there are optional extensions. Kobold2D does *not* have Xcode templates, instead it creates templates via the Kobold2D Project Starter tool installed in the Kobold2D base directory. This allows for better, more complex template projects than Xcode project templates ever could. – CodeSmile May 10 '12 at 20:48
  • Also, Kobold2D has ARC enabled out of the box. If you want to know how to enable it in cocos2d, read this: http://www.learn-cocos2d.com/2012/04/enabling-arc-cocos2d-project-howto-stepbystep-tutorialguide/ Lastly, I'm updating my Learn Cocos2D book to make all source code examples compatible with Kobold2D. – CodeSmile May 10 '12 at 20:50
  • Thought you'd be along to comment on this poast, Steffen. :) I would have gladly stuck with Kobold2D, but the sticking point was the Project Starter. It was difficult for me to know exactly which template I should use in certain exercises in various books and on various sites. An update to your book would be fantastic. Thanks for the input. I actually did follow the link you provided and I will do it again, now that everything is working with 2.0. – baptzmoffire May 10 '12 at 21:17

1 Answers1

1

cocos2d is fine, and ARC compatible for versions 1.1 (beta) and 2.0 (beta). I've been working with the 2.0 beta for a few months now, and its excellent. I'm guessing you tried to work with the 1.0.1 stable release which, as you said, is not ARC compatible.

I would recommend downloading 2.0-rc1, installing its templates from its root directory via ./install-templates.sh -f (-f forces overwrite, just in case.)

Blog post on the 2.0-rc1 release: http://www.cocos2d-iphone.org/archives/1885

EDIT: Just to clarify we're on the same page... I'm going to do a mini outline of the steps:

  1. Download and extract 2.0-rc1
  2. Go into Terminal, navigate to 2.0-rc1's extracted root folder
  3. Fully Quit all instances of Xcode
  4. Type this into console and press enter: ./install-templates.sh -f
  5. The results in Terminal look like this: http://pastebin.com/AVWKv3w1
  6. Re-open Xcode, click New Project -> click iOS or Mac OSX -> click "cocos2d v2.x" -> click "cocos2d iOS" or "cocos2d Mac" -> click Next
  7. Here is where I'm confused: My templates show no options for ARC enabling the project.
  8. Regardless of ARC, enter a project name -> click Next -> select directory -> click Create
  9. After project finishes indexing, select "iPad 5.1 Simulator" or "My Mac 64-bit" as target, and Build (CMD + B) the project, and it complains about FontManager.h?

Just wondering, are you creating a Mac or an iOS project? Anyway let me know how it goes. =( This is odd!

MechEthan
  • 5,703
  • 1
  • 35
  • 30
  • Thanks, Hachi. I was told to avoid the unstable versions by 2 different authors and one website, so that's why I hadn't tried those. You're correct. I've used the 1.0.1, as well as the 1.0.0 and 0.99-something versions. I'll give 2.0 a shot right now. – baptzmoffire May 10 '12 at 15:15
  • Ok. Noticing a theme, here. In every single version I've installed, building a blank project results in the same errors: "FontManager.h: No such file or directory" If this has anything to do with ARC, I'm not seeing how. I read in the "cocos2d error" link I posted above that these FontManager.h and FontLabelStringDrawing.h files have been deprecated. Googled that and found no suitable alternative or anything that actually fixes this problem. I can't have been the only one to come across this, can I? Did you run into this, HachiEthan? FORGOT TO MENTION: Tried 2.0 and 1.1, same error. – baptzmoffire May 10 '12 at 16:09
  • @baptzmoffire I'm a bit confused myself. I should clarify, I've been using the 2.0 beta but not with ARC. See my edit for more stuff... – MechEthan May 10 '12 at 16:41
  • Note: if you get FontManager errors the template you're using is not for cocos2d 2.0. – CodeSmile May 10 '12 at 20:47
  • @HachiEthan - WHAT the dilly?! lol For some strange reason, the 2.x templates are there now. (I swear I did the exact same thing you outlined 10x before. The entire time I was going through your steps, I was thinking, "This ain't gonna work. I did that, I did that. Mhm. Mhm." lol I don't know what the difference was, but somehow it worked.) To answer your questions, there was never an option to enable/disable ARC, I was using iOS all but one of the times with the previous projects. Thanks so much for your "EDIT," Hachi. After 3 days, fixed me right up! :) You're the man. – baptzmoffire May 10 '12 at 20:56