Reputation: 6326
I am trying to build a library file of g729 codec.i have source of this codec and trying to build using Android NDK.
Almost all object files are built but at last i am getting this error.
But i am stuck with this error. can anyone explain the meaning of this error and what should i do to solve this?
./obj/local/armeabi-v7a/objs/g729_jni/g729/cod_ld8a.o: In function `Coder_ld8a':
/root/g729/jni/g729/cod_ld8a.c:267: undefined reference to `Pitch_ol_fast'
/root/g729/jni/g729/cod_ld8a.c:325: undefined reference to `Pitch_fr3_fast'
/root/g729/jni/g729/cod_ld8a.c:328: undefined reference to `Enc_lag3'
/root/g729/jni/g729/cod_ld8a.c:344: undefined reference to `G_pitch'
collect2: ld returned 1 exit status
Thanks
Edit I have solved this error but is it feasible? I have added this line in Android.mk
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
Upvotes: 3
Views: 6395
Reputation: 3354
If you are compiling the sources and you want to link the resulting library you can use one of the following variables in your Android.mk file
LOCAL_STATIC_LIBRARIES: The list of static libraries modules (built with BUILD_STATIC_LIBRARY) that should be linked to this module. This only makes sense in shared library modules.
LOCAL_SHARED_LIBRARIES: The list of shared libraries modules this module depends on at runtime. This is necessary at link time and to embed the corresponding information in the generated file.
For more details have a look at the android NDK documentation that you can find in the ndk folder.
Otherwise if you have to link a prebuilt library there is a section in the Android NDK documentation that tells you how to achieve the result. An on-line version of these documents is also here(PREBUILTS).
UPDATE 09/01/2017
Documentation about Prebuilt libraries can be found here
Upvotes: 2