使用ffmpeg库编译错误undefined reference to `BZ2_bzDecompressInit'

root@xubbwd-desktop:/home/ffmpeg/1_ffmpeg-2.1.1/install/ff_audio_enc# make
gcc  muxing.c -o target -I ../include -L ../lib -lavformat -lavdevice -lavfilter -lavcodec -lavutil -lswresample -pthread  -ldl -lswscale -lasound -lz -lm
../lib/libavformat.a(matroskadec.o): In function `matroska_decode_buffer':
/home/ffmpeg/1_ffmpeg-2.1.1/libavformat/matroskadec.c:1187: undefined reference to `BZ2_bzDecompressInit'
/home/ffmpeg/1_ffmpeg-2.1.1/libavformat/matroskadec.c:1202: undefined reference to `BZ2_bzDecompress'
/home/ffmpeg/1_ffmpeg-2.1.1/libavformat/matroskadec.c:1195: undefined reference to `BZ2_bzDecompressEnd'
/home/ffmpeg/1_ffmpeg-2.1.1/libavformat/matroskadec.c:1207: undefined reference to `BZ2_bzDecompressEnd'
collect2: ld returned 1 exit status
make: *** [all] 错误 1


解决办法:
参数后加上-lbz2


root@xubbwd-desktop:/home/ffmpeg/1_ffmpeg-2.1.1/install/ff_audio_enc# make
gcc  muxing.c -o target -I ../include -L ../lib -lavformat -lavdevice -lavfilter -lavcodec -lavutil -lswresample -pthread  -ldl -lswscale -lasound -lz -lm -lbz2
root@xubbwd-desktop:/home/ffmpeg/1_ffmpeg-2.1.1/install/ff_audio_enc#

你可能感兴趣的:(ffmpeg)