用于android.error的ffmpeg构建:./ obj / local / arm64-v8a / libavcodec.so:错误添加符号:文件格式错误

时间:2017-09-15 07:24:15

标签: android ffmpeg

Android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := avcodec
LOCAL_SRC_FILES := libavcodec.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := avdevice
LOCAL_SRC_FILES := libavdevice.so
include $(PREBUILT_SHARED_LIBRARY)


include $(CLEAR_VARS)
LOCAL_MODULE := avfilter
LOCAL_SRC_FILES := libavfilter.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := avformat
LOCAL_SRC_FILES := libavformat.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := avutil
LOCAL_SRC_FILES := libavutil.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := swresample
LOCAL_SRC_FILES := libswresample.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := swscale
LOCAL_SRC_FILES := libswscale.so
include $(PREBUILT_SHARED_LIBRARY)


include $(CLEAR_VARS)
LOCAL_MODULE := ffmpeg_main
LOCAL_SRC_FILES := com_piyingke_app_common_ffmpeg_FFmpegUtil.c \
                   com_piyingke_app_common_ffmpeg_FFmpegUtil.h
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
LOCAL_LDLIBS := -llog -lz
LOCAL_SHARED_LIBRARIES := avcodec avdevice avfilter avformat avutil  swresample swscale
include $(BUILD_SHARED_LIBRARY)

我收到一个错误:

  

./ obj / local / arm64-v8a / libavcodec.so:错误添加符号:文件格式错误

     

clang ++:错误:链接器命令失败,退出代码为1(使用-v查看调用)

     

make:*** [obj / local / arm64-v8a / libffmpeg_main.so]错误1

我该怎么办?谁能帮助我。

1 个答案:

答案 0 :(得分:0)

你有Application.mk吗?

您应该只为预建文件运行构建。

喜欢这个:

APP_ABI:=armeabi-v7a