问题描述
我真的很难与安装我的Cocos2d-x项目,我无法想象下一个。
有大约45个错误我的程序,我会假设代码问题是由于它找不到任何包含的东西,如cocos2d.h。[/ p>
任何想法为什么不能找到这个?
谢谢
Tom
如果您写的话,您的程序找不到特定的头文件:
code> #includecocos2d.h
编译器将查找标题搜索路径。默认情况下,如果您使用第三方库(如cocos2d-x),则编译器将不会查找该库的文件夹。
所以你所做的是看对于您正在使用的IDE / Compiler中的构建设置,它会读取头文件搜索路径或附加包含路径,并将路径添加到包含cocos2d.h头文件的文件夹中。如果库的头部分布在多个文件夹中,或使用通配符路径(不受所有编译器/ IDE支持),则可能需要添加多个文件夹路径。
I'm really struggling with setting up my Cocos2d-x project for android, and I can't figure this next one out.
There's about 45 errors in my program, and I would assume that the code issues are spawned from the fact that it can't find any of the includes, like cocos2d.h.
Any idea why it wouldn't be able to find this?
Thanks
Tom
Your program can't find a particular header file if you write:
#include "cocos2d.h"
The compiler will look in the "Header Search Paths" for that file. By default, if you use a 3rd party library such as cocos2d-x, the compiler won't be looking in that library's folders.
So what you do is to look for a build setting in the IDE/Compiler that you're using that reads something like "Header Search Paths" or "Additional Includes Path" and add the path to the folder that contains the cocos2d.h header file. You may have to add multiple folder paths if the headers of the library are spread across multiple folders, or use a wildcard path (not supported by all compilers/IDEs).
这篇关于Cocos2d.h没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!