Linking error with external library

I’m using an external library (Namely : Spine runtime) and I have it’s source (.h/.c/.cpp files) in my class folder. I have no trouble using it on Android, but I have a linker error on Linux.

Here is my Linux Makefile :

``` EXECUTABLE = Wallie

INCLUDES = -I… -I…/Classes
-I…/Classes/spine
-I…/Classes/spine-c/include

SOURCES = main.cpp
…/Classes/AppDelegate.cpp
…/Classes/WallLayer.cpp
$(wildcard …/Classes/spine-c/scr/spine/.c)
$(wildcard …/Classes/spine/
.cpp)
#…/Classes/spine/*.cpp
#…/Classes/gamescreen.cpp
#…/Classes/ext/pugixml/pugixml.cpp

#STATICLIBS +=
#$(LIB_DIR)/libextension.a
#$(LIB_DIR)/libbox2d.a

COCOS_ROOT = …/…/…
include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk

SHAREDLIBS += -lcocos2d #-lbox2d
COCOS_LIBS = $(LIB_DIR)/libcocos2d.so

$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)

$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@

$(OBJ_DIR)/%.o: …/%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@

</blockquote>

And here is the out put for `Make run` :
<blockquote>

LINK bin/release/Wallie
obj/release/Classes/WallLayer.o: In function WallLayer::isInterruptible()': WallLayer.cpp:(.text+0x3ee): undefined reference tospAnimationState_getCurrent’
obj/release/Classes/WallLayer.o: In function WallLayer::animationStateEvent(spine::CCSkeletonAnimation*, int, spEventType, spEvent*, int)': WallLayer.cpp:(.text+0x7af): undefined reference tospAnimationState_getCurrent’
obj/release/Classes/spine/CCSkeletonAnimation.o: In function spine::CCSkeletonAnimation::~CCSkeletonAnimation()': CCSkeletonAnimation.cpp:(.text+0xb6): undefined reference tospAnimationStateData_dispose’
CCSkeletonAnimation.cpp:(.text+0xc2): undefined reference to spAnimationState_dispose' obj/release/Classes/spine/CCSkeletonAnimation.o: In functionspine::CCSkeletonAnimation::initialize()’:
CCSkeletonAnimation.cpp:(.text+0x147): undefined reference to spAnimationStateData_create' CCSkeletonAnimation.cpp:(.text+0x14f): undefined reference tospAnimationState_create’
obj/release/Classes/spine/CCSkeletonAnimation.o: In function spine::CCSkeletonAnimation::setAnimationStateData(spAnimationStateData*)': CCSkeletonAnimation.cpp:(.text+0x3c0): undefined reference tospAnimationStateData_dispose’
CCSkeletonAnimation.cpp:(.text+0x3cc): undefined reference to spAnimationState_dispose' CCSkeletonAnimation.cpp:(.text+0x3db): undefined reference tospAnimationState_create’
obj/release/Classes/spine/CCSkeletonAnimation.o: In function spine::CCSkeletonAnimation::setAnimation(int, char const*, bool)': CCSkeletonAnimation.cpp:(.text+0x454): undefined reference tospSkeletonData_findAnimation’
obj/release/Classes/spine/CCSkeletonAnimation.o: In function spine::CCSkeletonAnimation::addAnimation(int, char const*, bool, float)': CCSkeletonAnimation.cpp:(.text+0x4ca): undefined reference tospSkeletonData_findAnimation’
obj/release/Classes/spine/CCSkeletonAnimation.o: In function spine::CCSkeletonAnimation::update(float)': CCSkeletonAnimation.cpp:(.text+0x580): undefined reference tospAnimationState_update’
CCSkeletonAnimation.cpp:(.text+0x593): undefined reference to spAnimationState_apply' obj/release/Classes/spine/CCSkeletonAnimation.o: In functionspine::CCSkeletonAnimation::setMix(char const*, char const*, float)’:
CCSkeletonAnimation.cpp:(.text+0x40b): undefined reference to spAnimationStateData_setMixByName' obj/release/Classes/spine/CCSkeletonAnimation.o: In functionspine::CCSkeletonAnimation::setAnimation(int, char const*, bool)’:
CCSkeletonAnimation.cpp:(.text+0x479): undefined reference to spAnimationState_setAnimation' obj/release/Classes/spine/CCSkeletonAnimation.o: In functionspine::CCSkeletonAnimation::addAnimation(int, char const*, bool, float)’:
CCSkeletonAnimation.cpp:(.text+0x4f5): undefined reference to spAnimationState_addAnimation' obj/release/Classes/spine/CCSkeletonAnimation.o: In functionspine::CCSkeletonAnimation::getCurrent(int)’:
CCSkeletonAnimation.cpp:(.text+0x528): undefined reference to spAnimationState_getCurrent' obj/release/Classes/spine/CCSkeletonAnimation.o: In functionspine::CCSkeletonAnimation::clearTracks()’:
CCSkeletonAnimation.cpp:(.text+0x538): undefined reference to spAnimationState_clearTracks' obj/release/Classes/spine/CCSkeletonAnimation.o: In functionspine::CCSkeletonAnimation::clearTrack(int)’:
CCSkeletonAnimation.cpp:(.text+0x548): undefined reference to spAnimationState_clearTrack' obj/release/Classes/spine/CCSkeletonAnimation.o: In functionspine::CCSkeletonAnimation::update(float)’:
CCSkeletonAnimation.cpp:(.text+0x5a4): undefined reference to spSkeleton_updateWorldTransform' obj/release/Classes/spine/spine-cocos2dx.o: In functionspRegionAttachment_updateQuad(spRegionAttachment*, spSlot*, cocos2d::_ccV3F_C4B_T2F_Quad*, bool)’:
spine-cocos2dx.cpp:(.text+0x16c): undefined reference to spRegionAttachment_computeWorldVertices' obj/release/Classes/spine/CCSkeleton.o: In functionspine::CCSkeleton::~CCSkeleton()’:
CCSkeleton.cpp:(.text+0xd8): undefined reference to spAtlas_dispose' CCSkeleton.cpp:(.text+0xe4): undefined reference tospSkeleton_dispose’
CCSkeleton.cpp:(.text+0x10b): undefined reference to spSkeletonData_dispose' obj/release/Classes/spine/CCSkeleton.o: In functionspine::CCSkeleton::boundingBox()’:
CCSkeleton.cpp:(.text+0x80a): undefined reference to spRegionAttachment_computeWorldVertices' obj/release/Classes/spine/CCSkeleton.o: In functionspine::CCSkeleton::setSkeletonData(spSkeletonData*, bool)’:
CCSkeleton.cpp:(.text+0xa5f): undefined reference to spSkeleton_create' obj/release/Classes/spine/CCSkeleton.o: In functionspine::CCSkeleton::CCSkeleton(char const*, spAtlas*, float)’:
CCSkeleton.cpp:(.text+0xc01): undefined reference to spSkeletonJson_create' CCSkeleton.cpp:(.text+0xc2b): undefined reference tospSkeletonJson_readSkeletonDataFile’
CCSkeleton.cpp:(.text+0xc36): undefined reference to spSkeletonJson_dispose' obj/release/Classes/spine/CCSkeleton.o: In functionspine::CCSkeleton::CCSkeleton(char const*, char const*, float)’:
CCSkeleton.cpp:(.text+0xd41): undefined reference to spAtlas_readAtlasFile' CCSkeleton.cpp:(.text+0xd50): undefined reference tospSkeletonJson_create’
CCSkeleton.cpp:(.text+0xd7a): undefined reference to spSkeletonJson_readSkeletonDataFile' CCSkeleton.cpp:(.text+0xd85): undefined reference tospSkeletonJson_dispose’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::setSkin(char const*)': CCSkeleton.cpp:(.text+0xeac): undefined reference tospSkeleton_setSkinByName’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::setAttachment(char const*, char const*)': CCSkeleton.cpp:(.text+0xedc): undefined reference tospSkeleton_setAttachment’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::update(float)': CCSkeleton.cpp:(.text+0x160): undefined reference tospSkeleton_update’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::updateWorldTransform()': CCSkeleton.cpp:(.text+0xe48): undefined reference tospSkeleton_updateWorldTransform’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::setToSetupPose()': CCSkeleton.cpp:(.text+0xe58): undefined reference tospSkeleton_setToSetupPose’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::setBonesToSetupPose()': CCSkeleton.cpp:(.text+0xe68): undefined reference tospSkeleton_setBonesToSetupPose’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::setSlotsToSetupPose()': CCSkeleton.cpp:(.text+0xe78): undefined reference tospSkeleton_setSlotsToSetupPose’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::findBone(char const*) const': CCSkeleton.cpp:(.text+0xe88): undefined reference tospSkeleton_findBone’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::findSlot(char const*) const': CCSkeleton.cpp:(.text+0xe98): undefined reference tospSkeleton_findSlot’
obj/release/Classes/spine/CCSkeleton.o: In function spine::CCSkeleton::getAttachment(char const*, char const*) const': CCSkeleton.cpp:(.text+0xec8): undefined reference tospSkeleton_getAttachmentForSlotName’
collect2: error: ld returned 1 exit status
make: *** [bin/release/Wallie] Error 1

</blockquote>

It obviously a linker error that can't find my spine-c/include/spine/*.h files but I don't see where I'm wrong in the makefile. I cross posted in the Spine forum, without a solution yet. The runtimes provides an example for Android and for Windows, but not for Linux so far.


Resources : 
My bitbucket repo with all the code : https://bitbucket.org/monsieur_h/wallie/src
The android Makefile : https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2dx/example/proj.android/jni/Android.mk
Github repo with examples : https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-cocos2dx