title: LNK 2019 unresolved symbol - FFmpeg
body: <p>I'm trying to use FFmpeg to open and read a video .avi
  I work on win7 x64 with Visual Studio 2010</p>
  
  <p>For now my code is very simple:</p>
  
  <pre><code>#include "libavcodec/avcodec.h"
  #include "libavformat/avformat.h"
  #include "SDL.h"
  #include "SDL_mixer.h"
  
  
  int main (int argc, char *argv[]) {
  
  AVFormatContext *pFile_video;
  int             s, videoStream;
  AVCodecContext  *pCodecCtx;
  AVCodec         *pCodec;
  AVFrame         *pFrame; 
  AVFrame         *pFrameRGB;
  AVPacket        packet;
  int             frameFinished;
  int             numBytes;
  uint8_t         *buffer;
  
  av_register_all();
  
      if((avformat_open_input(&amp;pFile_video, "AR.avi", NULL,NULL)!=0)) cout &lt;&lt;"cannot open video file"&lt;&lt;endl;
      //if(av_find_stream_info(pFile_video) &lt;0) cout &lt;&lt;"cannot retrive stream information"&lt;&lt;endl;
  
      videoStream =-1;
      for(s=0; s&lt;pFile_video-&gt;nb_streams;s++){
          if((pFile_video-&gt;streams[s]-&gt;codec-&gt;codec_type) == AVMEDIA_TYPE_VIDEO) videoStream =s;
      }
      if(videoStream ==-1) cout &lt;&lt;"cannot open video stream"&lt;&lt;endl;
  
  f(SDL_Init(SDL_INIT_EVERYTHING)&lt; 0) cout&lt;&lt; "cannot initialize SDL subsystems"&lt;&lt;endl;
      if(Mix_OpenAudio(22050,MIX_DEFAULT_FORMAT,2, 4096) &lt;0) cout &lt;&lt;"error mixer audio"&lt;&lt;endl;
      music = Mix_LoadMUS("AR.wav");
      if(music == NULL) {cout &lt;&lt;"error loading music    "&lt;&lt;endl;
  }
  
  return 0;
  }
  </code></pre>
  
  <p>I linked following .lib files:</p>
  
  <pre><code>avcodec.lib
  avdevice.lib
  avfilter.lib
  avformat.lib
  avutil.lib
  postproc.lib
  swresample.lib
  swscale.lib
  </code></pre>
  
  <p>but I get these errors:</p>
  
  <pre><code>&gt;MSVCRTD.lib(cinitexe.obj) : warning LNK4098: la libreria predefinita 'msvcrt.lib' è in conflitto con l'utilizzo di altre librerie; utilizzare /NODEFAULTLIB:libreria
  1&gt;main_video_ffmpeg.obj : error LNK2019: riferimento al simbolo esterno "int __cdecl avformat_open_input(struct AVFormatContext * *,char const *,struct AVInputFormat *,struct AVDictionary * *)" (?avformat_open_input@@YAHPAPAUAVFormatContext@@PBDPAUAVInputFormat@@PAPAUAVDictionary@@@Z) non risolto nella funzione _SDL_main
  1&gt;main_video_ffmpeg.obj : error LNK2019: riferimento al simbolo esterno "void __cdecl av_register_all(void)" (?av_register_all@@YAXXZ) non risolto nella funzione _SDL_main
  1&gt;C:\Users\Cristina\Desktop\OpenCV\Progetti\MIEI_PROGETTI_Vs\video_ffmpeg\Debug\video_ffmpeg.exe : fatal error LNK1120: 2 esterni non risolti
  </code></pre>
  
  <p>I think it is a linker error.. but I haven't other .lib file for FFmpeg library.</p>