Android中的ffmpeg + libfaac编译错误

时间:2011-07-05 13:38:20

标签: android gcc ffmpeg java-native-interface

我已经成功地使用libfaac集成和编译了ffmpeg。当我尝试编译libfaac函数时,我收到此错误:

/home/admin1/Desktop/android/workspace/.../obj/local/armeabi/libavcodec.a(libfaac.o): In function `Faac_encode_close':
/home/admin1/Desktop/android/workspace/.../jni/ffmpeg/libavcodec/libfaac.c:145: undefined reference to `faacEncClose'
/home/admin1/Desktop/android/workspace/.../obj/local/armeabi/libavcodec.a(libfaac.o): In function `Faac_encode_frame':
/home/admin1/Desktop/android/workspace/.../jni/ffmpeg/libavcodec/libfaac.c:129: undefined reference to `faacEncEncode'
/home/admin1/Desktop/android/workspace/.../obj/local/armeabi/libavcodec.a(libfaac.o): In function `Faac_encode_init':
/home/admin1/Desktop/android/workspace/.../jni/ffmpeg/libavcodec/libfaac.c:47: undefined reference to `faacEncOpen'
/home/admin1/Desktop/android/workspace/.../jni/ffmpeg/libavcodec/libfaac.c:52: undefined reference to `faacEncGetCurrentConfiguration'
/home/admin1/Desktop/android/workspace/.../jni/ffmpeg/libavcodec/libfaac.c:55: undefined reference to `faacEncClose'
/home/admin1/Desktop/android/workspace/.../jni/ffmpeg/libavcodec/libfaac.c:76: undefined reference to `faacEncClose'
/home/admin1/Desktop/android/workspace/.../jni/ffmpeg/libavcodec/libfaac.c:103: undefined reference to `faacEncGetDecoderSpecificInfo'
/home/admin1/Desktop/android/workspace/.../jni/ffmpeg/libavcodec/libfaac.c:115: undefined reference to `faacEncSetConfiguration'
collect2: ld returned 1 exit status
make: *** [/home/admin1/Desktop/android/workspace/.../obj/local/armeabi/libxyz.so] Error 1

我不知道为什么我会收到此错误。

任何帮助将不胜感激......

1 个答案:

答案 0 :(得分:0)

我使用Android.mk的{​​{1}} ...

解决了这个问题

我忘了在LOCAL_LDLIBS中添加对libfaac.a文件的引用:

Android.mk