使用NDK构建FFMPEG时出现未定义的引用错误

时间:2015-03-20 13:08:19

标签: android c++ video android-ndk ffmpeg

我为我的ffmpeg android项目运行build-ndk时出现此错误

make: *** [obj/local/armeabi-v7a/libffmpeg-test-jni.so]
undefined reference to 'av_close_input_file'
undefined reference to 'av_find_stream_info'
undefined reference to 'av_open_input_file' 
undefined reference to 'avcodec_open'   

任何摆脱此错误的解决方案?我是ffmpeg和Android NDK的新手

这是我的Android MK文件

LOCAL_PATH := $(call my-dir)

#declare the prebuilt library
include $(CLEAR_VARS)

LOCAL_MODULE := ffmpeg-prebuilt
LOCAL_SRC_FILES := ffmpeg-2.5.4/android/armv7-a/libffmpeg.so
LOCAL_EXPORT_C_INCLUDES := ffmpeg-2.5.4/android/armv7-a/include
LOCAL_EXPORT_LDLIBS := ffmpeg-2.5.4/android/armv7-a/libffmpeg.so
LOCAL_LDLIBS += -llog -lavutil -lavformat -lavcodec -lz -lavutil -lm 
LOCAL_PRELINK_MODULE := true

include $(PREBUILT_SHARED_LIBRARY)

#the andzop library

include $(CLEAR_VARS)

LOCAL_ALLOW_UNDEFINED_SYMBOLS=false
LOCAL_MODULE := ffmpeg-test-jni
LOCAL_SRC_FILES := ffmpeg-test-jni.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/ffmpeg-2.5.4/android/armv7-a/include
LOCAL_SHARED_LIBRARY := ffmpeg-prebuilt
LOCAL_LDLIBS    := -llog -ljnigraphics -lz -lm $(LOCAL_PATH)/ffmpeg-2.5.4/android/armv7-a/libffmpeg.so 

include $(BUILD_SHARED_LIBRARY)

任何指针都非常感激 谢谢!

0 个答案:

没有答案