Hi Spine lords!
I have a problem working with spine runtimes for cocos 2dx, I do work with Visual Studio for windows compilation (which gives no problems at all) and also with eclipse for android compilation and I'm having big troubles to get spine to work with it.
For what I've been reading on cocos2dx forums it seems to be some problem with the android.mk file, even so I am not sure how to make it work. Here it is.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)
$(call import-add-path,$(LOCAL_PATH)/../../spine)
$(call import-add-path,$(LOCAL_PATH)/../../spine-c)
LOCAL_MODULE := cocos2dcpp_shared
LOCAL_MODULE_FILENAME := libcocos2dcpp
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp \
../../Classes/ClaseSelenita.cpp \
../../Classes/ClaseGlobo.cpp \
../../Classes/ClaseEsfera.cpp \
../../Classes/ClaseVentilador.cpp \
../../spine/include \
../../spineC/include
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
# LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static
# LOCAL_WHOLE_STATIC_LIBRARIES += spine_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,.)
$(call import-module,audio/android)
# $(call import-module,Box2D)
# $(call import-module,editor-support/cocosbuilder)
# $(call import-module,editor-support/spine)
# $(call import-module,editor-support/cocostudio)
# $(call import-module,network)
# $(call import-module,extensions)
And this is the error I'm getting each time I try to compile:
jni/../../Classes/ClaseSelenita.cpp:14: error: undefined reference to 'spine::SkeletonAnimation::createWithFile(std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char> > const&, std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char> > const&, float)'
jni/../../Classes/ClaseSelenita.cpp:15: error: undefined reference to 'spine::SkeletonAnimation::setAnimation(int, std::1::basic_string<char, std::1::char_traits<char>, std::__1::allocator<char> > const&, bool)'
Located in this piece of code:
Selenita::Selenita(cocos2d::Layer *layer, int x=-1, int y=-1) {
//Por alguna razón estos ficheros NO usan el mismo vector de Paths de fileUtils, usamos rutas relativas.
skeletonNode = SkeletonAnimation::createWithFile("..\\Resources\\common\\selenite.json", "..\\Resources\\common\\selenite.atlas", 1.0f);
skeletonNode->setAnimation(0, "cycle", true);
Since I am pretty new on this and this is my first time using spine runtimes I would appreciate kindness and patience in your explanations.
Thanks a lot.
Luis