title: Windows: How to build X264.lib instead of .dll
body: <p>I downloaded the X264 source and installed mingw.</p>
  
  <p>Step 1:</p>
  
  <p>Executed this in the MINGW bash:</p>
  
  <p>./configure --disable-cli --enable-shared --enable-win32thread -
  -extra-ldflags=-Wl,--output-def=libx264.def</p>
  
  <p>and then 'make'</p>
  
  <p>Step 2:</p>
  
  <p>Renamed the libx264-142.dll to libx264.dll and Opened up VS2012 Command Prompt and executed this:</p>
  
  <p>LIB /DEF:libx264.def</p>
  
  <p>which gave me libx264.lib and object libx264.exp</p>
  
  <p>Step 3:</p>
  
  <p>Included the lib file in a VS2012 project which uses the X264 API. </p>
  
  <p>Problem:</p>
  
  <p>When I start the project I get the following error message:</p>
  
  <p>"The program can't start because libx264.dll is missing from your computer"</p>
  
  <p>Question:</p>
  
  <p>Why is it looking for the dll when I'm linking the static library in?</p>
  
  <p>How do I resolve this? I would like to build a static X264 library which I can link in with my project.</p>
  
  <p>EDIT:</p>
  
  <p>I just had to put the dll in the same directory as the project executable.</p>
  
  <p>However - My question still stands: How do I build a <em>static</em> x264 library? So I don't need the dll?</p>