title: How to build libjpeg.lib for using it with ijg jpeg library?
body: <p>I want to read jpeg images for my program, which uses GIL (a Boost library). In the documentation for GIL, it is recommended to use the jpeg library present at <a href="http://www.ijg.org/" rel="nofollow">http://www.ijg.org/</a>. Among other things, it is also required to compile and link against <em>libjpeg.lib</em> for making it work.</p>
  
  <p>This is where I ran into a problem.</p>
  
  <p>There is no <em>libjpeg.lib</em> file available.</p>
  
  <p>I read the documentation( install.txt and libjpeg.txt ) of the ijg jpeg library, and got hinted that I will have to somehow build it myself. But so far, I have been unable to do so.</p>
  
  <p>The documentation says," The most convenient way to include the JPEG code into your executable program is to prepare a library file ("<em>libjpeg.a</em>", or a corresponding name on non-Unix machines) and reference it at your link step. The supplied makefiles build libjpeg.a automatically". </p>
  
  <p>However, when I tried to build it using command line of Visual Studio 2010, it generated a bunch of other files, but not <em>libjpeg.lib</em>.</p>
  
  <p>I searched a lot on Google, and tried several solutions, to no avail.</p>
  
  <p>I even got a <em>libjpeg.lib</em> file while searching, but including it gives another error - "cannot open <em>libc.lib</em>".</p>
  
  <p>I am using Visual Studio 2010 (native C++) on Windows 7.</p>
  
  <p>I have spent the past four days trying to make it work. Can someone of you knowledgable folks help me?</p>
  
  <p><strong>EDIT:</strong> I have got the answer to my question on my own. I have posted it below.</p>