通过jni移植pjsip协议到android上出现error: undefined reference to

移动开发 码拜 9年前 (2016-05-30) 2583次浏览
这是Android.mk文件:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_0
LOCAL_SRC_FILES := libpjsua-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_1
LOCAL_SRC_FILES := libpjsua2-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_2
LOCAL_SRC_FILES := libpjsip-ua-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_3
LOCAL_SRC_FILES := libpjsip-simple-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_4
LOCAL_SRC_FILES := libpjsip-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_5
LOCAL_SRC_FILES := libpjmedia-codec-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_6
LOCAL_SRC_FILES := libpjmedia-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_7
LOCAL_SRC_FILES := libpjmedia-videodev-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_8
LOCAL_SRC_FILES := libpjmedia-audiodev-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_9
LOCAL_SRC_FILES := libpjsdp-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_10
LOCAL_SRC_FILES := libpjnath-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_11
LOCAL_SRC_FILES := libpjlib-util-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_12
LOCAL_SRC_FILES := libpj-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_13
LOCAL_SRC_FILES := libg7221codec-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_14
LOCAL_SRC_FILES := libgsmcodec-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_15
LOCAL_SRC_FILES := libspeex-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_16
LOCAL_SRC_FILES := libilbccodec-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_17
LOCAL_SRC_FILES := libresample-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_18
LOCAL_SRC_FILES := libstdc++.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwolib_19
LOCAL_SRC_FILES := libsrtp-arm-unknown-linux-androideabi.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Mypjsua
LOCAL_SRC_FILES := mypjsua.cpp
LOCAL_LDLIBS := -llog
LOCAL_STATIC_LIBRARIES := libtwolib_0 libtwolib_1 libtwolib_2 libtwolib_3 libtwolib_4 libtwolib_5 libtwolib_6 libtwolib_7 libtwolib_8 libtwolib_9 libtwolib_10 libtwolib_11 libtwolib_12 libtwolib_13 libtwolib_14 libtwolib_15 libtwolib_16 libtwolib_17 libtwolib_18 libtwolib_19
include $(BUILD_SHARED_LIBRARY)
然后本人用ndk-build就出现了下面的错误,有高手知道怎么解决吗?
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
[armeabi-v7a] Compile++ thumb: Mypjsua <= mypjsua.cpp
[armeabi-v7a] SharedLibrary  : libMypjsua.so
D:/adt-bundle-windows-x86_64-20140702/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: jni/libpj-arm-unknown-linux-androideabi.a(rand.o): in function pj_srand:rand.c(.text+0x14): error: undefined reference to “srand”
D:/adt-bundle-windows-x86_64-20140702/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: jni/libpj-arm-unknown-linux-androideabi.a(rand.o): in function pj_rand:rand.c(.text+0x28): error: undefined reference to “rand”
D:/adt-bundle-windows-x86_64-20140702/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: jni/libsrtp-arm-unknown-linux-androideabi.a(rand_source.o): in function rand_source_get_octet_string:rand_source.c(.text+0x104): error: undefined reference to “rand”
D:/adt-bundle-windows-x86_64-20140702/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: jni/libsrtp-arm-unknown-linux-androideabi.a(cipher.o): in function cipher_type_self_test:cipher.c(.text+0xafc): error: undefined reference to “rand”
collect2: ld returned 1 exit status
make.exe: *** [obj/local/armeabi-v7a/libMypjsua.so] Error 1
解决方案

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明通过jni移植pjsip协议到android上出现error: undefined reference to
喜欢 (0)
[1034331897@qq.com]
分享 (0)