问题关键字:cocos2d-x ; win32; android; 闪退;无法编译;
问题1:
cannot open source file xxx.h
原因:该处不能重复
问题2:
no such file or directory #include "xxx.h"
原因:你在用命令cocos compile -p android编译时,编译器在文件里找不到你定义的.h和.cpp。因为你的.h和.cpp在win32.DEBUG里,不在cocos的根目录下。
解决方案:把你定义的xx.h和xx.cpp文件从G:\hello\simple\proj.win32\Debug.win32 复制到G:\hello\simple\Classes
同时,为了让编译器认识你的xx.cpp ,需要把xx.cpp加入到G:\hello\simple\proj.android\jni\android.mk里
加入格式如下:
问题3:
编译的时候,在win32平台上正常运行,在android设备上就会闪退
原因:你使用了不存在的资源,cocos2x编译成android需要手动把win32下的资源加入到cocos的resource里
解决方案:
移动到G:\hello\simple\Resources这个目录下(如qq.png)