首页 > 代码库 > cocos2d-x发生undefined reference to `XX'异常 一劳永逸解决办法
cocos2d-x发生undefined reference to `XX'异常 一劳永逸解决办法
cocos2d-x发生undefined reference to `XX‘错误 一劳永逸解决方法
参考文章:
http://blog.csdn.net/kafeidev/article/details/9157895
http://blog.csdn.net/fu_zk/article/details/12836431
eclipse cocos2dx项目,出现错误
E:/Acocos2d-x/cocos2d-1.0.1-x-0.11.0/MyBilliard/android/jni/../../Classes/HelloWorldScene.cpp:27: undefined reference to `GameLayer::GameLayer()‘ E:/Acocos2d-x/cocos2d-1.0.1-x-0.11.0/MyBilliard/android/jni/../../Classes/HelloWorldScene.cpp:27: undefined reference to
原因是android的nkd编译需要将每个cpp尽心进行声明
进入jni-->Classes目录下的Android.mk
LOCAL_SRC_FILES := AppDelegate.cpp HelloWorldScene.cpp
修改成如下:
LOCAL_MODULE_FILENAME := libcocos2dcppMY_CPP_LIST := $(wildcard $(LOCAL_PATH)/*.cpp)MY_CPP_LIST += $(wildcard $(LOCAL_PATH)/hellocpp/*.cpp)MY_CPP_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)LOCAL_SRC_FILES := $(MY_CPP_LIST:$(LOCAL_PATH)/%=%)LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
cocos2d-x发生undefined reference to `XX'异常 一劳永逸解决办法
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。