title: Unable to link with libx264.lib static library
body: <p>I'm building custom video encoder using x264 as a static library. I've followed <a href="http://kemuri9.net/dev/x264/other/intel_howto.html" rel="nofollow noreferrer">this</a> guide in order to build static library. Trying to compile this:</p>
  <pre><code>x264_t * setup_encoder(int width, int height){
      x264_param_t param;
      x264_param_default_preset(&amp;param, &quot;veryfast&quot;, &quot;zerolatency&quot;);
      param.i_threads = 1;
      param.i_width = width;
      param.i_height = height;
      param.i_fps_num = 26;
      param.i_fps_den = 1;
      // Intra refres:
      param.i_keyint_max = 26;
      param.b_intra_refresh = 1;
      //Rate control:
      param.rc.i_rc_method = X264_RC_CRF;
      param.rc.f_rf_constant = 25;
      param.rc.f_rf_constant = 25;
      param.rc.f_rf_constant_max = 35;
      //For streaming:
      param.b_repeat_headers = 1;
      param.b_annexb = 1;
      x264_param_apply_profile(&amp;param, &quot;baseline&quot;);
  
      return x264_encoder_open(&amp;param);
  }
  </code></pre>
  <p>Results in:</p>
  <blockquote>
  <p>main.obj : error LNK2019: unresolved external symbol &quot;int __cdecl x264_param_default_preset(struct x264_param_t *,char const *,char const *)&quot;</p>
  <p>main.obj : error LNK2019: unresolved external symbol &quot;int __cdecl x264_param_apply_profile(struct x264_param_t *,char const *)&quot;</p>
  <p>main.obj : error LNK2019: unresolved external symbol &quot;struct x264_t * __cdecl x264_encoder_open_136(struct x264_param_t *)&quot;</p>
  <p>%PROJECT_DIR%: fatal error LNK1120: 3 unresolved externals</p>
  </blockquote>
  <p>Linker scans libx264.lib, but can't find anything inside.</p>
  <pre><code>Searching .\lib\libx264.lib:
  </code></pre>
  <p>With dumpbin /HEADERS I can actually find the declaration I need, but linker is unable to do it.</p>
  <pre><code>SECTION HEADER #38
     .text name
         0 physical address
         0 virtual address
       E60 size of raw data
      930C file pointer to raw data (0000930C to 0000A16B)
      D219 file pointer to relocation table
         0 file pointer to line numbers
        40 number of relocations
         0 number of line numbers
  60501020 flags
           Code
           COMDAT; sym= x264_param_default_preset
           16 byte align
           Execute Read
  </code></pre>
  <p>Enviroment is Visual Studio 2012 with Intel Compiler 14 on Windows 8 64-bit.</p>