To compile libjpeg
9 in Visual Studio 2012, here are the steps (after unzipping the archive file):
-
Download the file
WIN32.MAK
(for example, from http://www.bvbcode.com/code/f2kivdrh-395674-down), and place a copy in the root source code directory (possiblyC:\jpeg-9
, but it depends where you unzipped it). I will refer to this directory as%jpegsrc%
from now on. Having this file is important; otherwise step 3 will produce an error. -
In the Visual Studio command prompt, open to
%jpegsrc%
:cd %jpegsrc%
-
At the same command prompt, execute the following:
NMAKE /f makefile.vc setup-v10
This will create two Visual Studio 2010 solutions in
%jpegsrc%
:jpeg.sln
andapps.sln
. -
Open each solution in Visual Studio 2012. Each one will prompt you to update all the projects to 2012 format. Click on “Update.” One time I did it, the prompt did not appear. In case that happens, right-click on the
jpeg
solution in the Solution Explorer, and choose “Update VC++ projects…,” which will produce the same prompt. -
Save and build each solution as normal. (You have to build the
jpeg.sln
solution beforeapps.sln
, since the latter depends on the former.)
Note: this process should work correctly in Visual Studio 2010, without the updating, but I have not tested it.
Update: This method still works in Visual Studio 2015 for libjpeg-9a
.