[問題] Android.mk 導致 undefined reference

作者: kinmogi (去去去...)   2015-03-18 09:34:19
各位大大們,我在寫 jni,利用 NDK去 build
我已經有第三方靜態庫(.a),要去build動態庫(.so)
一直出現 undefined reference to "xxxclass::xxx()"
看了很多網路的資料,還是解不出來,
以下是我 android.mk源碼
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libstatic
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libtk32x.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/head
include $(PREBUILT_STATIC_LIBRARY)
#========================
include $(CLEAR_VARS)
LOCAL_MODULE := JniDemo
LOCAL_SRC_FILES := com_example_jimyu_facedecunderjni_RunJNI.cpp Utility.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := libstatic
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
#===========
error message:
C:\Users\JimYu\AndroidStudioProjects\FaceDecUnderJni\app/src/main/jni/
arm64-v8a/libtk32x.a(tk32x.o): In function `GetLostCounterLimit':
/Users/max/AndroidStudioProjects/FaceTracker/app/src/main/jni/tk32x.cpp:657
: undefined reference to `CTracker::GetLostCount()'
我快哭了,麻煩各位高手了 QQ
作者: mshockwave (夏克維夫)   2015-03-18 13:24:00
你第一個module名字不用加lib但我想那不是問題所在(?
作者: kinmogi (去去去...)   2015-03-18 13:36:00
感謝你,結果還是一樣,我用的是 c++ 的 lib QQ

Links booklink

Contact Us: admin [ a t ] ucptt.com