title: C++ Ubuntu. Multiple undefined references compiling with FFMPEG libs
body: <p>I installed FFMPEG libraries on Ubuntu 12.10 and headers as it is described <a href="https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuideQuantal" rel="nofollow">here</a> .</p>
  
  <p>In my C++ application which uses FFMPEG when I am compiling (gcc) I am getting this :</p>
  
  <blockquote>
    <p>/usr/local/lib/libavcodec.a(libfaac.o): In function
    <code>Faac_encode_frame': /root/ffmpeg/libavcodec/libfaac.c:179: undefined
    reference to</code>faacEncEncode' /usr/local/lib/libavcodec.a(libfaac.o):
    In function <code>Faac_encode_close': /root/ffmpeg/libavcodec/libfaac.c:52:
    undefined reference to</code>faacEncClose'
    /usr/local/lib/libavcodec.a(libfaac.o): In function
    <code>Faac_encode_init': /root/ffmpeg/libavcodec/libfaac.c:78: undefined
    reference to</code>faacEncOpen' /root/ffmpeg/libavcodec/libfaac.c:88:
    undefined reference to <code>faacEncGetCurrentConfiguration'
    /root/ffmpeg/libavcodec/libfaac.c:139: undefined reference to
    </code>faacEncGetDecoderSpecificInfo' /root/ffmpeg/libavcodec/libfaac.c:153:
    undefined reference to <code>faacEncSetConfiguration'
    /usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function
    </code>aac_encode_close': /root/ffmpeg/libavcodec/libfdk-aacenc.c:99:
    undefined reference to <code>aacEncClose'
    /usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function
    </code>aac_encode_frame': /root/ffmpeg/libavcodec/libfdk-aacenc.c:344:
    undefined reference to <code>aacEncEncode'
    /usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function
    </code>aac_encode_init': /root/ffmpeg/libavcodec/libfdk-aacenc.c:116:
    undefined reference to <code>aacEncOpen'
    /root/ffmpeg/libavcodec/libfdk-aacenc.c:125: undefined reference to
    </code>aacEncoder_SetParam' /root/ffmpeg/libavcodec/libfdk-aacenc.c:132:
    undefined reference to <code>aacEncoder_SetParam'
    /root/ffmpeg/libavcodec/libfdk-aacenc.c:140: undefined reference to
    </code>aacEncoder_SetParam' /root/ffmpeg/libavcodec/libfdk-aacenc.c:160:
    undefined reference to <code>aacEncoder_SetParam'
    /root/ffmpeg/libavcodec/libfdk-aacenc.c:167: undefined reference to
    </code>aacEncoder_SetParam'
    /usr/local/lib/libavcodec.a(libfdk-aacenc.o):/root/ffmpeg/libavcodec/libfdk-aacenc.c:185:
    more undefined references to <code>aacEncoder_SetParam' follow
    /usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function
    </code>aac_encode_init': /root/ffmpeg/libavcodec/libfdk-aacenc.c:263:
    undefined reference to <code>aacEncEncode'
    /root/ffmpeg/libavcodec/libfdk-aacenc.c:269: undefined reference to
    </code>aacEncInfo' /usr/local/lib/libavcodec.a(libmp3lame.o): In function
    <code>mp3lame_encode_frame': /root/ffmpeg/libavcodec/libmp3lame.c:204:
    undefined reference to</code>lame_encode_buffer_float'
    /root/ffmpeg/libavcodec/libmp3lame.c:188: undefined reference to
    <code>lame_encode_buffer' /root/ffmpeg/libavcodec/libmp3lame.c:191:
    undefined reference to</code>lame_encode_buffer_int'
    /root/ffmpeg/libavcodec/libmp3lame.c:210: undefined reference to
    <code>lame_encode_flush' /usr/local/lib/libavcodec.a(libmp3lame.o): In
    function</code>mp3lame_encode_close':
    /root/ffmpeg/libavcodec/libmp3lame.c:88: undefined reference to
    <code>lame_close' /usr/local/lib/libavcodec.a(libmp3lame.o): In function
    </code>mp3lame_encode_init': /root/ffmpeg/libavcodec/libmp3lame.c:100:
    undefined reference to <code>lame_init'
    /root/ffmpeg/libavcodec/libmp3lame.c:104: undefined reference to
    </code>lame_set_num_channels' /root/ffmpeg/libavcodec/libmp3lame.c:105:
    undefined reference to <code>lame_set_mode'
    /root/ffmpeg/libavcodec/libmp3lame.c:108: undefined reference to
    </code>lame_set_in_samplerate' /root/ffmpeg/libavcodec/libmp3lame.c:109:
    undefined reference to <code>lame_set_out_samplerate'
    /root/ffmpeg/libavcodec/libmp3lame.c:113: undefined reference to
    </code>lame_set_quality' /root/ffmpeg/libavcodec/libmp3lame.c:115: undefined
    reference to <code>lame_set_quality'
    /root/ffmpeg/libavcodec/libmp3lame.c:119: undefined reference to
    </code>lame_set_VBR' /root/ffmpeg/libavcodec/libmp3lame.c:120: undefined
    reference to <code>lame_set_VBR_quality'
    /root/ffmpeg/libavcodec/libmp3lame.c:123: undefined reference to
    </code>lame_set_brate' /root/ffmpeg/libavcodec/libmp3lame.c:127: undefined
    reference to <code>lame_set_bWriteVbrTag'
    /root/ffmpeg/libavcodec/libmp3lame.c:130: undefined reference to
    </code>lame_set_disable_reservoir' /root/ffmpeg/libavcodec/libmp3lame.c:133:
    undefined reference to <code>lame_init_params'
    /root/ffmpeg/libavcodec/libmp3lame.c:139: undefined reference to
    </code>lame_get_encoder_delay' /root/ffmpeg/libavcodec/libmp3lame.c:142:
    undefined reference to <code>lame_get_framesize'
    /usr/local/lib/libavcodec.a(libopencore-amr.o): In function
    </code>amr_wb_decode_close': /root/ffmpeg/libavcodec/libopencore-amr.c:363:
    undefined reference to <code>D_IF_exit'
    /usr/local/lib/libavcodec.a(libopencore-amr.o): In function
    </code>amr_nb_decode_frame': /root/ffmpeg/libavcodec/libopencore-amr.c:122:
    undefined reference to <code>Decoder_Interface_Decode'
    /usr/local/lib/libavcodec.a(libopencore-amr.o): In function
    </code>amr_wb_decode_frame': /root/ffmpeg/libavcodec/libopencore-amr.c:352:
    undefined reference to <code>D_IF_decode'
    /usr/local/lib/libavcodec.a(libopencore-amr.o): In function
    </code>amr_nb_encode_frame': /root/ffmpeg/libavcodec/libopencore-amr.c:267:
    undefined reference to <code>Encoder_Interface_Encode'
    /usr/local/lib/libavcodec.a(libopencore-amr.o): In function
    </code>amr_wb_decode_init': /root/ffmpeg/libavcodec/libopencore-amr.c:318:
    undefined reference to <code>D_IF_init'
    /usr/local/lib/libavcodec.a(libopencore-amr.o): In function
    </code>amr_nb_encode_close': /root/ffmpeg/libavcodec/libopencore-amr.c:222:
    undefined reference to <code>Encoder_Interface_exit'
    /usr/local/lib/libavcodec.a(libopencore-amr.o): In function
    </code>amr_nb_decode_close': /root/ffmpeg/libavcodec/libopencore-amr.c:86:
    undefined reference to <code>Decoder_Interface_exit'
    /usr/local/lib/libavcodec.a(libopencore-amr.o): In function
    </code>amr_nb_encode_init': /root/ffmpeg/libavcodec/libopencore-amr.c:205:
    undefined reference to <code>Encoder_Interface_init'
    /usr/local/lib/libavcodec.a(libopencore-amr.o): In function
    </code>amr_nb_decode_init': /root/ffmpeg/libavcodec/libopencore-amr.c:73:
    undefined reference to <code>Decoder_Interface_init'
    /usr/local/lib/libavcodec.a(libspeexdec.o): In function
    </code>libspeex_decode_frame': /root/ffmpeg/libavcodec/libspeexdec.c:139:
    undefined reference to <code>speex_bits_remaining'
    /root/ffmpeg/libavcodec/libspeexdec.c:147: undefined reference to
    </code>speex_bits_read_from' /root/ffmpeg/libavcodec/libspeexdec.c:152:
    undefined reference to <code>speex_decode_int'
    /root/ffmpeg/libavcodec/libspeexdec.c:140: undefined reference to
    </code>speex_bits_peek_unsigned' /root/ffmpeg/libavcodec/libspeexdec.c:158:
    undefined reference to <code>speex_decode_stereo_int'
    /usr/local/lib/libavcodec.a(libspeexdec.o): In function
    </code>libspeex_decode_close': /root/ffmpeg/libavcodec/libspeexdec.c:169:
    undefined reference to <code>speex_bits_destroy'
    /root/ffmpeg/libavcodec/libspeexdec.c:170: undefined reference to
    </code>speex_decoder_destroy' /usr/local/lib/libavcodec.a(libspeexdec.o): In
    function <code>libspeex_decode_init':
    /root/ffmpeg/libavcodec/libspeexdec.c:48: undefined reference to
    </code>speex_packet_to_header' /root/ffmpeg/libavcodec/libspeexdec.c:67:
    undefined reference to <code>speex_header_free'
    /root/ffmpeg/libavcodec/libspeexdec.c:82: undefined reference to
    </code>speex_lib_get_mode' /root/ffmpeg/libavcodec/libspeexdec.c:100:
    undefined reference to <code>speex_bits_init'
    /root/ffmpeg/libavcodec/libspeexdec.c:101: undefined reference to
    </code>speex_decoder_init' /root/ffmpeg/libavcodec/libspeexdec.c:110:
    undefined reference to <code>speex_std_stereo_request_handler'
    /root/ffmpeg/libavcodec/libspeexdec.c:113: undefined reference to
    </code>speex_decoder_ctl' /root/ffmpeg/libavcodec/libspeexdec.c:43:
    undefined reference to `speex_nb_mode'</p>
  </blockquote>
  
  <p>and more ....</p>
  
  <p>When I compile I link against these libs:</p>
  
  <p><strong>-lfaac -lavformat -lavcodec -lavutil -lavfilter  -lswscale</strong> </p>
  
  <p>What is the problem ? </p>