Failed to link static libraries using Android NDK r5b

Recently upgraded to NDK r5b, and the assembly failed using the "undefined reference" for functions located in the static library.

Here is the error

/home/brian/workspace/VoiceEngineDemo/obj/local/armeabi-v7a/objs-debug/voiceenginejni/voice_engine_jni.o: In function `initVE':
/home/brian/workspace/VoiceEngineDemo/jni/voice_engine_jni.c:944: undefined reference to `VE_ADT_create'

The link process does not seem to load the static module, although it is defined in Android.mk as follows:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE               := voiceenginejni

LOCAL_SRC_FILES            := voice_engine_jni.c printing.c jaudio.c etime.c

LOCAL_CFLAGS               := -D __arm  -D ANDROID -D USE_AEC_DEFAULTS -D USE_EC_DEFAULTS -D _DEBUG -D EC_VARIANT=EC_VARIANT_NEC -D AECG1_5_ENABLE

LOCAL_STATIC_LIBRARIES     := libvoiceengine libcpufeatures libaecg2

LOCAL_LDLIBS               := -llog -ldl    

include $(BUILD_SHARED_LIBRARY)

$(call import-module,cpufeatures)    

The VE_ADT_create function is located in libvoiceengine.a, which is located in the / obj / local / armeabi -v7a / directory.

I would appreciate it if anyone could shed light on this for me. Thank!

+3
source share
2 answers
+1

ndk-build?

, , toolchain jni-, LOCAL_LDLIBS:

LOCAL_LDLIBS := libvoiceengine.a
+1

Source: https://habr.com/ru/post/1795868/


All Articles