android-ndk-r8d/build/core/build-binary.mk:41: *** target file
`clean' has both : and :: entries. Stop.
`clean' has both : and :: entries. Stop.
我也遇到了相同的问题,不过经过一步步排查,是因为在libavfilter目录中的Makefile的末尾处多了 Clean 这个玩意儿 将其注释掉或者删掉就可以了
恢复改方法
/libavutil/libm.h:183:40: error: static declaration of 'truncf' follows non-static declaration
libm.h的static方法删除掉
/*#define av_restrict restrict*/
#define restrict
#define restrict
file included from jni/ffmpeg/libavcodec/aacdec.c:82:0:
jni/ffmpeg/libavcodec/../libavutil/float_dsp.h:150:50: error: expected ';', ',' or ')' before 'v1'
jni/ffmpeg/libavcodec/aacdec.c: In function 'apply_mid_side_stereo':
jni/ffmpeg/libavcodec/aacdec.c:1746:29: error: 'AVFloatDSPContext' has no member named 'butterflies_float'
make: *** [obj/local/armeabi/objs/avcodec/aacdec.o] Error 1
jni/ffmpeg/libavcodec/../libavutil/float_dsp.h:150:50: error: expected ';', ',' or ')' before 'v1'
jni/ffmpeg/libavcodec/aacdec.c: In function 'apply_mid_side_stereo':
jni/ffmpeg/libavcodec/aacdec.c:1746:29: error: 'AVFloatDSPContext' has no member named 'butterflies_float'
make: *** [obj/local/armeabi/objs/avcodec/aacdec.o] Error 1
c、修改jni/ffmpeg/config.h下的
#define avrestrict restrict为#define restrict
这个应该改为 #define av_restrict
#define avrestrict restrict为#define restrict
这个应该改为 #define av_restrict
stdlib 的错误
/home/usr/android-ndk-r9/platforms/android-18/arch-arm/usr/include/stdlib.h:54:14: error: expected identifier or '(' before 'void'
/home/usr/android-ndk-r9/platforms/android-18/arch-arm/usr/include/stdlib.h:54:14: error: expected ')' before numeric constant
/home/usr/android-ndk-r9/platforms/android-18/arch-arm/usr/include/stdlib.h:54:14: error: expected ')' before numeric constant
--extra-cflags="-I${NDK_ROOT}/platforms/${PLATFORM}/arch-arm/usr/include -fPIC -DANDROID -std=c99"
添加了I,应该是stdlib的头文件没有找对导致的
jni/ffmpeg/libavutil/parseutils.c:541:15: error: storage size of 'dt' isn't known
jni/ffmpeg/libavutil/parseutils.c:634:20: error: variable 'dt2' has initializer but incomplete type
jni/ffmpeg/libavutil/parseutils.c:634:38: error: invalid type argument of unary '*' (have 'int')
jni/ffmpeg/libavutil/parseutils.c:634:54: error: invalid type argument of unary '*' (have 'int')
jni/ffmpeg/libavutil/parseutils.c:634:23: error: storage size of 'dt2' isn't known
这个问题的解决方法是:打开 libavutil/parseutils.h,把 #include <time.h> 替换为 #include <sys/../time.h>
undefined reference to 'inflateReset'
在libAvcodec的mk文件里做修改、
参考
http://blog.sina.com.cn/s/blog_5c4dd3330100mpdx.html
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../av.mk
LOCAL_SRC_FILES := $(FFFILES)
LOCAL_C_INCLUDES :=
$(LOCAL_PATH)
$(LOCAL_PATH)/..
LOCAL_CFLAGS += $(FFCFLAGS)
LOCAL_LDLIBS := -lz
LOCAL_STATIC_LIBRARIES := $(FFLIBS)
LOCAL_MODULE := $(FFNAME)
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../av.mk
LOCAL_SRC_FILES := $(FFFILES)
LOCAL_C_INCLUDES :=
$(LOCAL_PATH)
$(LOCAL_PATH)/..
LOCAL_CFLAGS += $(FFCFLAGS)
LOCAL_LDLIBS := -lz
LOCAL_STATIC_LIBRARIES := $(FFLIBS)
LOCAL_MODULE := $(FFNAME)
include $(BUILD_STATIC_LIBRARY)
/home/wjh/fox/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: /home/wjh/fox/android-ndk-r9c/samples/player/obj/local/armeabi/libavcodec.a(log2_tab.o): multiple definition of 'ff_log2_tab'
/home/wjh/fox/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/wjh/fox/android-ndk-r9c/samples/player/obj/local/armeabi/libavformat.a(log2_tab.o): previous definition here
/home/wjh/fox/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: /home/wjh/fox/android-ndk-r9c/samples/player/obj/local/armeabi/libavutil.a(log2_tab.o): multiple definition of 'ff_log2_tab'
/home/wjh/fox/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/wjh/fox/android-ndk-r9c/samples/player/obj/local/armeabi/libavformat.a(log2_tab.o): previous definition here
去掉libavforma里Android.mk里的zlib
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../av.mk
LOCAL_SRC_FILES := $(FFFILES)
LOCAL_C_INCLUDES :=
$(LOCAL_PATH)
$(LOCAL_PATH)/..
LOCAL_CFLAGS += $(FFCFLAGS)
LOCAL_CFLAGS += -include "string.h" -Dipv6mr_interface=ipv6mr_ifindex
#LOCAL_LDLIBS := -lz
#LOCAL_STATIC_LIBRARIES := $(FFLIBS)
LOCAL_MODULE := $(FFNAME)
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../av.mk
LOCAL_SRC_FILES := $(FFFILES)
LOCAL_C_INCLUDES :=
$(LOCAL_PATH)
$(LOCAL_PATH)/..
LOCAL_CFLAGS += $(FFCFLAGS)
LOCAL_CFLAGS += -include "string.h" -Dipv6mr_interface=ipv6mr_ifindex
#LOCAL_LDLIBS := -lz
#LOCAL_STATIC_LIBRARIES := $(FFLIBS)
LOCAL_MODULE := $(FFNAME)
include $(BUILD_STATIC_LIBRARY)
libavformat/libavformat.a(log2_tab.o):(.rodata+0x0): multiple definition of `ff_log2_tab'
libavcodec/libavcodec.a(log2_tab.o):(.rodata+0x0): first defined here
libavutil/libavutil.a(log2_tab.o):(.rodata+0x0): multiple definition of `ff_log2_tab'
libavcodec/libavcodec.a(log2_tab.o):(.rodata+0x0): first defined here
移植ffmpeg的时候如果遇到这样的情况,在两个文件的Makefile中删掉一个log2_tab.o文件就可以了
打开libavformat的Makefile文件
lls1.o
lls2.o
log.o
# log2_tab.o
mathematics.o
md5.o
mem.o
删除文件,如果是多行,就不要用注释了,直接删除掉
修改libavcodec的Makefile
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
OBJS-$(CONFIG_SHARED) += log2_tab.o
OBJS-$(CONFIG_SINEWIN) += sinewin.o
OBJS-$(CONFIG_SHARED) += log2_tab.o
OBJS-$(CONFIG_SINEWIN) += sinewin.o
------------------------------------------
-------------------------------------------