Saturday, March 22, 2008

PBRT without MSVC

PBRT is awesome. But the problem is the source code was supposed to be build using MSVC. It seems after searching the PBRT forum and googling, currently nobody has ever tried to build the code without MSVC on Windows (on Linux is said to be fine, but we have to modify the core source). I spent about several hours yesterday to build it using Code::Blocks and Mingw. It runs quite smooth until when I have to link Openexr prebuild for MSVC. Some issues around MSVC and Mingw like functions and DLL calls compatibility. Especially, the DLL link issue is still difficult to handle using currently available dlltool, reimp, and pexports. The only thinkable solutions at present are: (1) Build the Openexr source using Mingw, (2) Eplicitly call MSVC DLL using LoadLibrary() and getProcessAddress()... But currently, I don't have time, maybe later. Facing these problems, now I remember why while we are in Java we insist on pure Java, and focus on solving the problem rather than the tools. But let us face this reality and gain some lessons and understanding. Maybe later we will make PBRT in Java. Here I take a note on some relevant links.

http://www.mingw.org/MinGWiki/index.php/MixingCompilers

http://aegisknight.org/cppinterface.html

http://www.codeguru.com/forum/archive/index.php/t-379193.html

Here is other important tip to compile PBRT on MSVC.

No comments: