2010-07-29 42 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