I’m using cocos2d-x project and I want to link my own shared library to it.
That library is built with same config as cocos2d-x (ndk version, etc.).
In Android.mk of the project there is line:
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static
And in ROOT/obj/local/armeabi
there are all these static libraries: libcocos2d.a, libextensions.a, …
I just copy my so-library into /obj/local/armeabi of the project, and add into mk: LOCAL_LDLIBS += -lThe2D
and it fails to find such library. I know that I can specify search path but, I think, this is wrong way. There should be some place I can link own libraries. Any suggestions?
————-
I’ve found how to link it in ugly way:
LOCAL_LDLIBS += -L$(LOCAL_PATH)/../obj/local/armeabi -lThe2D
LOCAL_SHARED_LIBRARIES := The2D
No linker error, but when eclipse builds the project and runs it, my library isn’t copied into install path. Only these one:
Install : libgame.so => libs/armeabi/libgame.so
Install : libgnustl_shared.so => libs/armeabi/libgnustl_shared.so
And application crashes on device because it can’t find the library (The2D).