以下错误都是android的环境下:
1.不要使用__super()来调用父类的方法,因为GCC不能编译,可以使用父类的名称调用如:CCLayer::init();
2. 因为GCC编译的问题,不要在类的定义中写,如在MyScene头文件中,定义方法 void MyScene::backCallBack(); 应该写 void backCallBack();
3.Dex Loader] Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer; 这个错误是因为
ADT升级之后自动加了一个Android Dependencies的库,加在了java构建路径那里。只要我把它移除就好了。
4.'>>' should be '> >' within a nested template argument list 错误
如果直接这样写:
std::vector<std::vector<std::string>> data;
gcc编译器会把">>"当成operator,报错:boost vector error: ‘>>’ should be ‘> >’ within a nested template argument list
正确做法是加上空格:
std::vector<std::vector<std::string> > data;