CREATE_LAYER_FUNC cocos 2dx - 错误

时间:2013-01-17 15:30:10

标签: java android c++ cocos2d-x

有人可以告诉我如何修复此错误吗?

jan@home:~/bin/cocos2dx/CocosTest/proj.android$ ./build_native.sh
NDK_ROOT = /home/jan/bin/android-ndk-r8d
COCOS2DX_ROOT = /home/jan/bin/cocos2dx/CocosTest/proj.android/../..
APP_ROOT = /home/jan/bin/cocos2dx/CocosTest/proj.android/..
APP_ANDROID_ROOT = /home/jan/bin/cocos2dx/CocosTest/proj.android
Using prebuilt externals
make: Entering directory `/home/jan/bin/cocos2dx/CocosTest/proj.android'
Compile++ thumb  : game_shared <= main.cpp
In file included from jni/hellocpp/main.cpp:6:0:
jni/../../Classes/DoYourJobScene.h:10:30: error: ISO C++ forbids declaration of 'LAYER_CREATE_FUNC' with no type [-fpermissive]
make: *** [obj/local/armeabi/objs/game_shared/hellocpp/main.o] Error 1
make: Leaving directory `/home/jan/bin/cocos2dx/CocosTest/proj.android'
jan@home:~/bin/cocos2dx/CocosTest/proj.android$

来源:http://jandroid.ch/CocosTest.tgz

1 个答案:

答案 0 :(得分:0)

LAYER_CREATE_FUNC和SCENE_CREATE_FUNC可以替换为一个宏CREATE_FUNC See this!

所以你应该知道该怎么做。