2010-07-29 40 views
2

我下面教程http://www.bit-101.com/blog/?p=2115.In本教程中,我发现了一个项目模板,并通过它开始....cocos2d的错误

我已经下载了cocos2d-iphone-0.99.1添加子目录 cocos2d的项目... 。但当我建我得到9错误和4 worning

Scene.h: No such file or directory Director’ undeclared (first use in this function) /Volumes/Jobed/cocos2d/CCTexture2D.m:79:24: error: FontManager.h: No such file or directory /Volumes/Jobed/cocos2d/CCTexture2D.m:80:35: error: FontLabelStringDrawing.h: No such file or directory /Volumes/Jobed/cocos2d/CCTexture2D.m: In function ‘-[CCTexture2D(Text) initWithString:fontName:fontSize:]‘: /Volumes/Jobed/cocos2d/CCTexture2D.m:519: error: ‘ZFont’ undeclared (first use in this function) /Volumes/Jobed/cocos2d/CCTexture2D.m:519: error: (Each undeclared identifier is reported only once /Volumes/Jobed/cocos2d/CCTexture2D.m:519: error: for each function it appears in.) /Volumes/Jobed/cocos2d/CCTexture2D.m:519: error: ‘zFont’ undeclared (first use in this function) /Volumes/Jobed/cocos2d/CCTexture2D.m:519: error: ‘FontManager’ undeclared (first use in this function) /Volumes/Jobed/cocos2d/CCTexture2D.m:521: warning: ‘NSString’ may not respond to ‘-sizeWithZFont:’ /Volumes/Jobed/cocos2d/CCTexture2D.m:521: warning: (Messages without a matching method signature /Volumes/Jobed/cocos2d/CCTexture2D.m:521: warning: will be assumed to return ‘id’ and accept /Volumes/Jobed/cocos2d/CCTexture2D.m:521: warning: ‘…’ as arguments.) /Volumes/Jobed/cocos2d/CCTexture2D.m:521: error: incompatible types in assignment /Volumes/Jobed/cocos2d/CCTexture2D.m: In function ‘-[CCTexture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:]‘: /Volumes/Jobed/cocos2d/CCTexture2D.m:567: error: ‘FontManager’ undeclared (first use in this function) /Volumes/Jobed/cocos2d/CCTexture2D.m:569: warning: ‘NSString’ may not respond to ‘-drawInRect:withZFont:lineBreakMode:alignment:’

等等。我不知道为什么......我是新能帮助?

回答

6

有一阵子,cocos2d重新命名了所有的类。他们现在都以CC开头。在你上面的例子中,你应该使用CCDirector.h,而不是Director.h

查看cocos2d API了解更多详情。

看过您发布的教程后,它看起来像包含在其中的信息有点过时。我想你会发现安装说明特别麻烦。我建议找一个更好的教程。有几个发布在cocos2d网站上。 Here's关于如何安装cocos2d的更新指南。

编辑:我应该直接发布链接到cocos2d programming guide。它包含您需要知道的所有信息。

+1

您好感谢.. 但什么 #进口“FontManager.h” #进口“FontLabelStringDrawing.h” 的是没有文件如CCFontManager.h ... – Rony 2010-07-29 05:03:05

+0

那些已全部折旧。看看这个,而不是:http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:labels – LandonSchropp 2010-07-29 05:07:24

+0

我其实想开发应用程序,如应用程序商店中的funball ... 但不知道在哪我应该去的方式....教程你看起来不错,但你可以给我链接更多的教程来开发应用程序? 无论书籍或教程是否付费......感谢.. – Rony 2010-07-29 05:14:24