cocos2d错误:没有这样的文件或目录 [英] cocos2d errors: No such file or directory

查看:117
本文介绍了cocos2d错误:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照教程 http://www.bit-101.com / blog /?p = 2115 。在本教程中,我找到了一个项目模板并开始进行操作。

I am following the tutorial http://www.bit-101.com/blog/?p=2115. In this tutorial I found a project template and go through it to begin.

我已经下载了cocos2d-iphone-0.99.1,并将子目录
cocos2d添加到了项目中…。但是当我建造时,我得到9个错误和4个警告

I have downloaded cocos2d-iphone-0.99.1 add the subdirectory cocos2d to project….but when I built I got 9 error and 4 warning


Scene.h:没有这样的文件或目录
Director'未声明(第一次在
中使用此函数)
/Volumes/Jobed/cocos2d/CCTexture2D.m:79:24:
错误:FontManager.h:无此类文件或
目录
/卷/作业/cocos2d/CCTexture2D.m:80:35:
错误:FontLabelStringDrawing.h:否
这样的文件或目录
/卷/作业/ cocos2d / CCTexture2D .m:
在函数'-[CCTexture2D(Text)
initWithString:fontName:fontSize:]':
/卷/作业/cocos2d/CCTexture2D.m:519:
错误:未声明 ZFont(在此函数中首先使用

/Volumes/Jobed/cocos2d/CCTexture2D.m:519:
错误:(报告的每个未声明标识符为
仅一次
/卷/作业/ cocos2d / CCTextur e2D.m:519:
错误:每个功能都出现
。)
/卷/Jobed/cocos2d/CCTexture2D.m:519:
错误:'zFont'未声明(此函数中先使用

/Volumes/Jobed/cocos2d/CCTexture2D.m:519:
错误:未声明'FontManager'(此函数中第一个使用
的对象)
/卷/作业/cocos2d/CCTexture2D.m:521:
警告:'NSString'可能不响应
'-sizeWithZFont:'
/卷/作业/ cocos2d / CCTexture2D.m:521:
警告:(没有匹配
方法签名的消息
/Volumes/Jobed/cocos2d/CCTexture2D.m:521:
警告:假定为返回
'id'并接受
/Volumes/Jobed/cocos2d/CCTexture2D.m:521:
警告:'...'作为参数。)
/ Volumes / Jobed / cocos2d /CCTexture2D.m:521:
错误:
分配中的类型不兼容
/Volumes/Jobed/cocos2d/CCTexture2D.m:
在函数'-[CCTexture2D(Text)
initWithString:dimensions:alignment:fontName:fontSize:]':
/Volumes/Jobed/cocos2d/CCTexture2D.m:567:
错误:未声明'FontManager'(此功能中的第一个
使用)
/Volumes/Jobed/cocos2d/CCTexture2D.m: 569:
警告: NSString可能不会响应
'-drawInRect:withZFont:lineBreakMode:alignment:'

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

A little while back cocos2d renamed all of their classes. They now all begin with CC. In your above example, you should be using CCDirector.h, not Director.h

看看 cocos2d API 了解更多详情。

在您发布的教程中,其中包含的信息看起来有些过时了。我想您会发现安装说明特别麻烦。我建议找到一个更好的教程。在cocos2d网站上有几篇文章。 此处有关如何进行更新的最新指南安装cocos2d。

After looking at the tutorial you posted, it looks like the information contained within it is a little out of date. I think you'll find the installation instructions especially troublesome. I'd suggest finding a better tutorial. There are several posted on the cocos2d site. Here's a more up to date guide on how to install cocos2d.

编辑:我应该发布指向 cocos2d编程指南。它包含您入门所需的所有信息。

I should have posted a link to the cocos2d programming guide directly. It contains all the information you need to know to get started.

这篇关于cocos2d错误:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆