title: avcodec symbols not found
body: <p>I am trying to build the example code in FFMPEG library 
  I add the libavcode.h , libavcode.a in my project and I set the header search usr/local/include and the library search to usr/local/lib </p>
  
  <p>when I compile the example I got this errors ... ( all of them related to avcodec library)</p>
  
  <p>{</p>
  
  <pre><code>Undefined symbols:
   "avcodec_find_encoder(CodecID)", referenced from:
    video_encode_example(char const*, CodecID)in main.o
    "avcodec_open2(AVCodecContext*, AVCodec*, AVDictionary**)", referenced from:
    video_encode_example(char const*, CodecID)in main.o
    video_decode_example(char const*, char const*)in main.o
    "av_init_packet(AVPacket*)", referenced from:
    video_decode_example(char const*, char const*)in main.o
    "av_free(void*)", referenced from:
    video_encode_example(char const*, CodecID)in main.o
    video_encode_example(char const*, CodecID)in main.o
    video_encode_example(char const*, CodecID)in main.o
    video_decode_example(char const*, char const*)in main.o
    video_decode_example(char const*, char const*)in main.o
    "avcodec_alloc_context3(AVCodec*)", referenced from:
    video_encode_example(char const*, CodecID)in main.o
    video_decode_example(char const*, char const*)in main.o
    "av_opt_set(void*, char const*, char const*, int)", referenced from:
    video_encode_example(char const*, CodecID)in main.o
    "av_image_alloc(unsigned char**, int*, int, int, PixelFormat, int)", referenced from:
    video_encode_example(char const*, CodecID)in main.o
    "avcodec_encode_video(AVCodecContext*, unsigned char*, int, AVFrame const*)", referenced from:
    video_encode_example(char const*, CodecID)in main.o
    video_encode_example(char const*, CodecID)in main.o
    "avcodec_register_all()", referenced from:
    _main in main.o
    "avcodec_find_decoder(CodecID)", referenced from:
    video_decode_example(char const*, char const*)in main.o
    "avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, AVPacket const*)", referenced from:
    video_decode_example(char const*, char const*)in main.o
    video_decode_example(char const*, char const*)in main.o
    "avcodec_close(AVCodecContext*)", referenced from:
    video_encode_example(char const*, CodecID)in main.o
    video_decode_example(char const*, char const*)in main.o
    "avcodec_alloc_frame()", referenced from:
    video_encode_example(char const*, CodecID)in main.o
    video_decode_example(char const*, char const*)in main.o
   ld: symbol(s) not found
   collect2: ld returned 1 exit status
  </code></pre>
  
  <p>}
  do you know why I got this problem ? </p>
  
  <p>Thanks </p>