使用cocos compile -p android编译cocos2dx项目的时候出现如下错误(新建了TestScene.h,TestScene.cpp):
jni/../../Classes/AppDelegate.cpp:: error: undefined reference to 'TestScene::createScene()'
clang++.exe: error: linker command failed with exit code (use -v to see invocation)
make.exe: *** [obj/local/armeabi/libMyGame.so] Error
make.exe: Leaving directory `D:/projects/HelloWorldCpp/proj.android'
执行命令出错,返回值:。
编辑proj.android/jni/目录下的Android.mk文件,在
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp
处追加上你所有新建的文件(我这里是TestScene.cpp),重新编译,通过。