使用Cocos Creator 1.5.2中使用的cocos2d-x-3.9构建应用程序时。
但是得到以下错误。
[armeabi-v7a] SharedLibrary : libMyGame.so
~/proj.android-studio/app/jni/../../../cocos2d/cocos/./2d/CCNode.cpp:1244: error: undefined reference to 'creator::CameraNode::getInstance()'
~/proj.android-studio/app/jni/../../../cocos2d/cocos/./2d/CCNode.cpp:1247: error: undefined reference to 'creator::CameraNode::containsNode(cocos2d::Node*)'
~/proj.android-studio/app/jni/../../../cocos2d/cocos/./base/CCDirector.cpp:1031: error: undefined reference to 'spine::SkeletonBatch::destroyInstance()'
~/proj.android-studio/app/jni/../../../cocos2d/cocos/./renderer/CCRenderer.cpp:885: error: undefined reference to 'creator::CameraNode::getInstance()'
~/proj.android-studio/app/jni/../../../cocos2d/cocos/./renderer/CCRenderer.cpp:893: error: undefined reference to 'creator::CameraNode::getVisibleRect()'
collect2: error: ld returned 1 exit status
答案 0 :(得分:0)
在“cocos / Android.mk”中添加以下两句话
LOCAL_STATIC_LIBRARIES += creator_static
LOCAL_STATIC_LIBRARIES += spine_static
如:
257 LOCAL_STATIC_LIBRARIES + = cocos_chipmunk_static
258 LOCAL_STATIC_LIBRARIES + = cocos_zlib_static
259 LOCAL_STATIC_LIBRARIES + = creator_static
260 LOCAL_STATIC_LIBRARIES + = spine_static
“cocos / Android.mk”第221行第308行--71% - 第1列