Cocos2d.h No such file or directory

僤鯓⒐⒋嵵緔 提交于 2019-12-08 04:11:18

问题


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


回答1:


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).



来源:https://stackoverflow.com/questions/6356181/cocos2d-h-no-such-file-or-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!