我有 4 个静态库libavcodec.a libavutil.a libswscale.a libx264.a
我想把它与libmytest.so
我在 Android.mk 脚本下面试过
LOCAL_PATH := $(call my-dir)
INITIAL_PATH := $(LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE := mytest
LOCAL_SRC_FILES := mytest.c
LOCAL_LDLIBS += -llog
LOCAL_WHOLE_STATIC_LIBRARIES := libavutil libavcodec libswscale libx264
include $(BUILD_SHARED_LIBRARY)
mytest.c
从这些库中调用许多函数。4 个库被放置在PROJECTPATH\jni\
.
但是我undefined reference
从这些库中获得了所有功能。
我尝试给予LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
允许我创建共享库,但是当我启动应用程序时,我得到
01-22 07:15:15.650: E/AndroidRuntime(9655): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1285]: 1868 cannot locate 'avcodec_register_all'...
01-22 07:15:15.650: E/AndroidRuntime(9655): at java.lang.Runtime.loadLibrary(Runtime.java:370)
01-22 07:15:15.650: E/AndroidRuntime(9655): at java.lang.System.loadLibrary(System.java:535)