- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在关注教程http://www.bit-101.com/blog/?p=2115 。在本教程中,我找到了一个项目模板并通过它开始。
我已经下载了cocos2d-iphone-0.99.1 添加子目录cocos2d 到项目......但是当我构建时我收到 9 个错误和 4 个警告
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:’
等等……为什么?
最佳答案
不久前,cocos2d 重命名了它们的所有类。现在它们都以 CC 开头。在上面的示例中,您应该使用 CCDirector.h,而不是 Director.h
看看 cocos2d API了解更多详情。
查看您发布的教程后,看起来其中包含的信息有点过时了。我想你会发现安装说明特别麻烦。我建议寻找更好的教程。 cocos2d 网站上发布了几个。 Here's有关如何安装 cocos2d 的最新指南。
编辑:我应该发布一个指向 cocos2d programming guide 的链接直接地。它包含您开始使用时需要了解的所有信息。
关于iphone - cocos2d错误: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3359551/
我是一名优秀的程序员,十分优秀!