您的位置:首页 > 移动开发 > Cocos引擎

cocos2dx添加新的类后出现错误undefined reference to的解决办法

2016-08-09 11:44 513 查看
使用cocos compile -p android编译cocos2dx项目的时候出现如下错误(新建了TestScene.h,TestScene.cpp):

jni/../../Classes/AppDelegate.cpp:79: error: undefined reference to 'TestScene::createScene()'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make.exe: *** [obj/local/armeabi/libMyGame.so] Error 1
make.exe: Leaving directory `D:/projects/HelloWorldCpp/proj.android'
执行命令出错,返回值:2。


编辑proj.android/jni/目录下的Android.mk文件,在

LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp


处追加上你所有新建的文件(我这里是TestScene.cpp),重新编译,通过。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐