Cocos2d-x android 编译错误 undefined reference to 'MenuScene::getInstance()'

前端之家收集整理的这篇文章主要介绍了Cocos2d-x android 编译错误 undefined reference to 'MenuScene::getInstance()'前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

原因:没有找到对应的MenuScene@H_502_3@.cpp文件。@H_502_3@@H_502_3@

@H_502_3@

虽然文件在../../Classes文 件夹里面,但是在Android.mk里面../../Classes只是头文件搜索路径,没有放到编译的文件里面。@H_502_3@所以这里在链接的时候找不到对应的源文件。@H_502_3@@H_502_3@
解决方案:修改@H_502_3@Android.mk文件@H_502_3@LOCAL_SRC_FILES,将@H_502_3@@H_502_3@

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

改成@H_502_3@

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

../../Classes/StartScene.cpp \@H_502_3@
../../Classes/TopMenu.cpp \ ../../Classes/GameLayer.cpp \ ../../Classes/GameScene.cpp \ ../../Classes/WelcomeLayer.cpp \ ../../Classes/WelcomeScene.cpp \ ../../Classes/GameData.cpp \@H_502_3@

猜你在找的Cocos2d-x相关文章