Here is a manual solution to the compilation issue. I am currently
working to construct a complete, noBS, ready-to-compile source package
of pbrt for MSVC++ 2008.
------------------------------------------------
TEN PHASES FOR COMPILING PBRT WITH MSVC++ 2008
------------------------------------------------
by Robert G Graf,
http://www.goofers.org
Last updated Monday, February 2, 2009.
------------------------------------------------
---------------
GENERAL NOTES
---------------
* In all compilation cases, ignore warnings.
The most frequent warnings include "Wp64"
compatibility mode, "possible loss of data",
and Secure CRT.
* Any errors about missing library files in the current
compilation should be checked by recompiling the prerequisit
projects or solutions. This may only be a problem if a
build has been canceled at some point for any reason.
-----------------------------------
PHASE 1: Satisfying Prerequisites
-----------------------------------
1.1) Download and install Bison and Flex setup packages.
http://gnuwin32.sourceforge.net/
1.2) Add "<GnuPath>\bin" to the "path" environment variable
where <GnuPath> is the directory where the software
was installed, e.g. "C:\Program Files\GnuWin32".
1.3) Log Off and Log On to update path variable, or restart the
computer.
1.4) Confirm that the path environment is set properly by
running "bison" and "flex" from the command-line DOS window
or from the Windows Run option. No errors should occur.
1.5) The file "lex.yy.c" that flex created an be deleted.
1.6) Ensure that a Microsoft Visual C++ 2008 (MSVC) product is
installed.
1.7) Preferably, at your discretion, perform a Windows Update
to install all new critical updates and service packs for
Windows and MSVC products.
-------------------------------
PHASE 2: Downloading Packages
-------------------------------
2.1) Create or use a download directory for the remaining files.
Place all downloaded files into this directory.
2.2) Download "zlib compiled DLL, version 1.2.3".
http://www.zlib.net/
2.3) Download "IlmBase 1.0.1 source code release".
http://www.openexr.com/
2.4) Download "OpenEXR 1.6.1 source code release".
http://www.openexr.com/
2.5) Download "pbrt-src-1.03.zip, for Windows".
http://www.pbrt.org/
-------------------------
PHASE 3: Preparing zlib
-------------------------
3.1) Extract the zlib file into the download directory.
This will create "include", "lib" directories, etc in
the download directory.
3.2) Ensure that "zlib1.dll" is in the top-level download
directory, "zdll.lib" is in the "lib" directory, and
"zconf.h" and "zlib.h" are in the "include" directory.
-----------------------------
PHASE 4: Compiling ILM Base
-----------------------------
4.1) Extract the ILM Base archive into the download directory.
This should create an "ilmbase-x.x.x" directory where
x.x.x is the version number.
4.2) Open MSVC, and then open the "IlmBase.sln" solution file
located in "ilmbase-x.x.x\vc\vc8\IlmBase".
4.3) Follow the Conversion Wizard instructions to update the
solution, accepting default settings if preferred.
4.4) Build the solution for the Debug configuration.
4.5) Build the solution for the Release configuration.
4.6) Close MSVC.
----------------------------
PHASE 5: Compiling OpenEXR
----------------------------
5.1) Extract the OpenEXR archive into the download directory.
This should create an "openexr-x.x.x" directory where
x.x.x is the version number.
5.2) Copy the following zlib files into the Deploy directories below.
The Deploy directory will be located in the same directory as
the download directory.
zlib1.dll -> Deploy\bin\Debug
zlib1.dll -> Deploy\bin\Release
zconf.h -> Deploy\include
zlib.h -> Deploy\include
zdll.lib -> Deploy\lib\Debug
zdll.lib -> Deploy\lib\Release
5.3) Open MSVC, and then open the "OpenEXR.sln" solution file
located in "openexr-x.x.x\vc\vc8\OpenEXR".
5.4) Follow the Conversion Wizard instructions to update the
solution, accepting default settings if preferred.
5.5) Build the solution for the Debug configuration.
Note that build can take a while during tests.
If the tests are taking too long, you can cancel
the build, and rebuild after disabling the "IlmImfTest"
project via the Configuration Manager.
5.6) Build the solution for the Release configuration.
Note that build can take a while during tests.
If the tests are taking too long, you can cancel
the build, and rebuild after disabling the "IlmImfTest"
project via the Configuration Manager.
5.7) Close MSVC.
-------------------------
PHASE 6: Compiling pbrt
-------------------------
6.1) Extract the pbrt archive into the download directory.
This should create a "pbrt-x.x" directory where
x.x is the version number.
6.2) Open MSVC, and then open the "pbrt.sln" solution file
located in "pbrt-x.x\win32".
6.3) Follow the Conversion Wizard instructions to update the
solution, accepting default settings if preferred.
6.4) Make Debug the active configuration mode.
6.5) In the "core" project, remove "c:\cygwin\bin\" from the
"Command Line" of the "pbrtlex.l" and "pbrtparse.y" files
in the "Parser Files" directory under the project folder.
Right-clicking each file in turn, and selecting Properties
reveals the Property Pages where this setting can be
changed under the General, Custom Build Step section.
6.6) Repeat step 6.5 for the Release mode configuration as well.
6.7) Create an empty text file named "unistd.h" inside of the
"pbrt-x.x\core" directory.
6.8) Open the "core" project Properties Pages and remove
all references to "openexr-1.4.0-vs2005" from
the "Additional Include Directories" and
"Additional Library Directories".
6.9) Insert "../../../../Deploy/include" into the
"Additional Include Directories".
6.10) Insert "../../../../Deploy/lib/Debug" into the
"Additional Library Directories".
6.11) Change "zlib1d.lib" to "zdll.lib" in the Linker,
Input, "Additional Dependencies" entry.
6.12) Insert "OPENEXR_DLL" into the "Preprocessor Definitions"
under the C/C++, Preprocessor category.
6.13) Make Release the selected configuration and
Repeat steps 6.8 through 6.12 but substituting
"Release" for "Debug" in the directory names
when appropriate. Don't forget to update the zlib
and preprocessor items.
6.14) Right-click the "core" project, and select "Project Only",
then "Build Only core".
6.15) In the "core" project file "pbrtlex.cpp", replace
"isatty(" with "_isatty(". Note the underscore.
6.16) Copy the file "zlib1.dll" into the top-level pbrt
MSVC solution directory, e.g. "pbrt-x.x\win32".
6.17) Build the solution for which ever configuration
is appropriate.
6.18) If you receive one or more errors, simply build
the solution again, and the errors should disappear.
6.19) Set the "renderer" project as the StartUp Project.
6.20) Save the solution and all its projects.
6.21) Close MSVC.
-----------------------
PHASE 7: Copying DLLs
-----------------------
7.1) Copy the DLL files in "Deploy/bin/Debug" or
"Deploy/bin/Release" into an appropriate
location such as "%SystemRoot%\System32", or
into the directory that "pbrt.exe" is located in.
The last option is to include one of the DLL
directory paths in the "path" environment variable.
7.2) READ THIS: IMPORTANT, EXTREMELY IMPORTANT!!
Ensure that the DLLs used match the most
recent build configuration of pbrt in MSVC.
In order to execute a Debug version of pbrt.exe
and its associated plugins, pbrt.exe must link
against the Debug version of the DLLs compiled
earlier on. A similar configuration is necessary
to execute the Release version of pbrt.exe and
its associated plugins. Remember: pbrt in Debug
needs Debug DLLs, and Release pbrt needs Release DLLs.
Failure to do this will result in a run-time
exception that displays an operating system dialog
box stating: "This application has failed to start
because MSVCR90D.dll was not found. Re-installing
the application may fix this problem."
---------------------------
PHASE 8: Configuring pbrt
---------------------------
8.1) Set the "PBRT_SEARCHPATH" environment variable
to the directory that contains "pbrt.exe" and
all of its associated plugin DLL files.
8.2) Add the full pbrt executable directory path to the
"path" environment variable in order to execute it
from any directory.
8.3) Log Off and Log On, or restart the computer
for the new environment variables to take effect.
-----------------------
PHASE 9: Testing pbrt
-----------------------
9.1) Render a sample image, and then view the resulting OpenEXR
image.
"pbrt simple.pbrt"
-------------------------
PHASE 10: Enjoying pbrt
-------------------------
10.1) Render whatever you want!