C ++ Ubuntu。使用FFMPEG库编译的多个未定义引用

时间:2013-05-19 11:18:04

标签: c++ linux ubuntu gcc

我在Ubuntu 12.10和标题上安装了FFMPEG库,如here所述。

在我编译时使用FFMPEG的C ++应用程序(gcc)中我得到了这个:

  

/usr/local/lib/libavcodec.a(libfaac.o):In function   Faac_encode_frame': /root/ffmpeg/libavcodec/libfaac.c:179: undefined reference to faacEncEncode'/usr/local/lib/libavcodec.a(libfaac.o):   在函数Faac_encode_close': /root/ffmpeg/libavcodec/libfaac.c:52: undefined reference to faacEncClose'中   /usr/local/lib/libavcodec.a(libfaac.o):在功能上   Faac_encode_init': /root/ffmpeg/libavcodec/libfaac.c:78: undefined reference to faacEncOpen'/root/ffmpeg/libavcodec/libfaac.c:88:   对faacEncGetCurrentConfiguration' /root/ffmpeg/libavcodec/libfaac.c:139: undefined reference to faacEncGetDecoderSpecificInfo'/root/ffmpeg/libavcodec/libfaac.c:153的未定义引用:   对faacEncSetConfiguration' /usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function aac_encode_close'的未定义引用:/root/ffmpeg/libavcodec/libfdk-aacenc.c:99:   对aacEncClose' /usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function aac_encode_frame'的未定义引用:/root/ffmpeg/libavcodec/libfdk-aacenc.c:344:   对aacEncEncode' /usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function aac_encode_init'的未定义引用:/root/ffmpeg/libavcodec/libfdk-aacenc.c:116:   对aacEncOpen' /root/ffmpeg/libavcodec/libfdk-aacenc.c:125: undefined reference to aacEncoder_SetParam'/root/ffmpeg/libavcodec/libfdk-aacenc.c:132的未定义引用:   对aacEncoder_SetParam' /root/ffmpeg/libavcodec/libfdk-aacenc.c:140: undefined reference to aacEncoder_SetParam'/root/ffmpeg/libavcodec/libfdk-aacenc.c:160的未定义引用:   对aacEncoder_SetParam' /root/ffmpeg/libavcodec/libfdk-aacenc.c:167: undefined reference to aacEncoder_SetParam'的未定义引用   /usr/local/lib/libavcodec.a(libfdk-aacenc.o):/root/ffmpeg/libavcodec/libfdk-aacenc.c:185:   更多未定义的对aacEncoder_SetParam' follow /usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function aac_encode_init'的引用:/root/ffmpeg/libavcodec/libfdk-aacenc.c:263:   对aacEncEncode' /root/ffmpeg/libavcodec/libfdk-aacenc.c:269: undefined reference to aacEncInfo'/usr/local/lib/libavcodec.a(libmp3lame.o)的未定义引用:在函数中   mp3lame_encode_frame': /root/ffmpeg/libavcodec/libmp3lame.c:204: undefined reference to lame_encode_buffer_float”   /root/ffmpeg/libavcodec/libmp3lame.c:188:未定义引用   lame_encode_buffer' /root/ffmpeg/libavcodec/libmp3lame.c:191: undefined reference to lame_encode_buffer_int”   /root/ffmpeg/libavcodec/libmp3lame.c:210:未定义引用   lame_encode_flush' /usr/local/lib/libavcodec.a(libmp3lame.o): In function mp3lame_encode_close':   /root/ffmpeg/libavcodec/libmp3lame.c:88:未定义引用   lame_close' /usr/local/lib/libavcodec.a(libmp3lame.o): In function mp3lame_encode_init':/ root/ffmpeg/libavcodec/libmp3lame.c:100:   对lame_init' /root/ffmpeg/libavcodec/libmp3lame.c:104: undefined reference to lame_set_num_channels'/root/ffmpeg/libavcodec/libmp3lame.c:105的未定义引用:   对lame_set_mode' /root/ffmpeg/libavcodec/libmp3lame.c:108: undefined reference to lame_set_in_samplerate'/root/ffmpeg/libavcodec/libmp3lame.c:109的未定义引用:   对lame_set_out_samplerate' /root/ffmpeg/libavcodec/libmp3lame.c:113: undefined reference to lame_set_quality'/root/ffmpeg/libavcodec/libmp3lame.c:115的未定义引用:undefined   对lame_set_quality' /root/ffmpeg/libavcodec/libmp3lame.c:119: undefined reference to lame_set_VBR'/root/ffmpeg/libavcodec/libmp3lame.c:120的引用:undefined   引用lame_set_VBR_quality' /root/ffmpeg/libavcodec/libmp3lame.c:123: undefined reference to lame_set_brate'/root/ffmpeg/libavcodec/libmp3lame.c:127:undefined   对lame_set_bWriteVbrTag' /root/ffmpeg/libavcodec/libmp3lame.c:130: undefined reference to lame_set_disable_reservoir'/root/ffmpeg/libavcodec/libmp3lame.c:133的引用:   对lame_init_params' /root/ffmpeg/libavcodec/libmp3lame.c:139: undefined reference to lame_get_encoder_delay'/root/ffmpeg/libavcodec/libmp3lame.c:142的未定义引用:   对lame_get_framesize' /usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_wb_decode_close'的未定义引用:/root/ffmpeg/libavcodec/libopencore-amr.c:363:   对D_IF_exit' /usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_decode_frame'的未定义引用:/root/ffmpeg/libavcodec/libopencore-amr.c:122:   对Decoder_Interface_Decode' /usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_wb_decode_frame'的未定义引用:/root/ffmpeg/libavcodec/libopencore-amr.c:352:   对D_IF_decode' /usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_encode_frame'的未定义引用:/root/ffmpeg/libavcodec/libopencore-amr.c:267:   对Encoder_Interface_Encode' /usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_wb_decode_init'的未定义引用:/root/ffmpeg/libavcodec/libopencore-amr.c:318:   对D_IF_init' /usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_encode_close'的未定义引用:/root/ffmpeg/libavcodec/libopencore-amr.c:222:   对Encoder_Interface_exit' /usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_decode_close'的未定义引用:/root/ffmpeg/libavcodec/libopencore-amr.c:86:   对Decoder_Interface_exit' /usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_encode_init'的未定义引用:/root/ffmpeg/libavcodec/libopencore-amr.c:205:   对Encoder_Interface_init' /usr/local/lib/libavcodec.a(libopencore-amr.o): In function amr_nb_decode_init'的未定义引用:/root/ffmpeg/libavcodec/libopencore-amr.c:73:   对Decoder_Interface_init' /usr/local/lib/libavcodec.a(libspeexdec.o): In function libspeex_decode_frame'的未定义引用:/root/ffmpeg/libavcodec/libspeexdec.c:139:   对speex_bits_remaining' /root/ffmpeg/libavcodec/libspeexdec.c:147: undefined reference to speex_bits_read_from'/root/ffmpeg/libavcodec/libspeexcc:152的未定义引用:   对speex_decode_int' /root/ffmpeg/libavcodec/libspeexdec.c:140: undefined reference to speex_bits_peek_unsigned'/root/ffmpeg/libavcodec/libspeexdec.c:158的未定义引用:   对speex_decode_stereo_int' /usr/local/lib/libavcodec.a(libspeexdec.o): In function libspeex_decode_close'的未定义引用:/root/ffmpeg/libavcodec/libspeexdec.c:169:   对speex_bits_destroy' /root/ffmpeg/libavcodec/libspeexdec.c:170: undefined reference to speex_decoder_destroy'/usr/local/lib/libavcodec.a(libspeexdec.o)的未定义引用:In   function libspeex_decode_init': /root/ffmpeg/libavcodec/libspeexdec.c:48: undefined reference to speex_packet_to_header'/root/ffmpeg/libavcodec/libspeexdec.c:67:   对speex_header_free' /root/ffmpeg/libavcodec/libspeexdec.c:82: undefined reference to speex_lib_get_mode'/root/ffmpeg/libavcodec/libspeexcc:100的未定义引用:   对speex_bits_init' /root/ffmpeg/libavcodec/libspeexdec.c:101: undefined reference to speex_decoder_init'/root/ffmpeg/libavcodec/libspeexdec.c:110的未定义引用:   对speex_std_stereo_request_handler' /root/ffmpeg/libavcodec/libspeexdec.c:113: undefined reference to speex_decoder_ctl'/root/ffmpeg/libavcodec/libspeexcc:43的未定义引用:   未定义的引用`speex_nb_mode'

以及更多....

当我编译时,我链接这些库:

-lfaac -lavformat -lavcodec -lavutil -lavfilter -lswscale

有什么问题?

1 个答案:

答案 0 :(得分:2)

我设法编译。对于那些感兴趣的人:

首先我禁用了一些模块(我实际上并没有使用):

./ configure --enable-gpl --enable-libass --enable-libfaac --enable-libfdk-aac --enable-libmp3lame \    - disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libspeex --enable- librtmp --disable-libtheora \   --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3

然后我按顺序链接其余的依赖项:

-lavformat -lavcodec -lfaac -lmp3lame -lfdk-aac -lvpx -lx264 -lavdevice -lyasm -lavutil -lswscale -lrtmp -lvorbisenc -lva