Welcome 微信登录

首页 / 操作系统 / Linux / Windows下编译安装PBRT V1.05

由于要用到网上的一个插件。虽然现在PBRT已经出了V2版本。仍然需要编译下PBRTV1版本。V1的各个版本功能相似,只是不断的修正BUGS的过程。因此选择了V1的最后一个版本PBRTV 1.05。1)首先从官网上下载:pbrt-src-1.05.zip, for Windows (620kB)2)将文件解压到目录c:pbrt-v13)在Windows下编译OpenEXR 见http://www.linuxidc.com/Linux/2012-08/68605.htm4)先编译项目core。通过后再编译其他项目在目录C:pbrt-v1pbrt-1.05win32下打开pbrt.sln4.1)将配置属性设置为All Configurations。项目属性->Configuration Properties->General->IntermediateDirectory设置为../tmp/$(ProjectName)/Output Directory设置为../../bin4.2) 在core项目的属性里VC++Directories中的Include Directories中加入:C:Deployincludecore项目右键->Properties->Linker->General->AdditionalLibrary Directories改为C:DeploylibWin32Release4.3)由于我用的是ZLIB-1.2.5版本,其对应的dll和lib分别为zlibwapi.dll和zlibwapi.lib将core右键->Properties->Linker->AdditionalDependecies,将其改为:Half.libIex.libIlmImf.libImath.libzlibwapi.libIlmThread.lib4.4)在core目录下新建文件unistd.h。内容如下:#ifndef _UNISTD_H   #define _UNISTD_H   #include <io.h>  #include <process.h>  #endif /* _UNISTD_H */4.5) 在core右键->Properties->C/C++->Preprocessor->PreprocessorDefinition部分加入OPENEXR_DLL4.6) 在core/exrio.cpp文件中,注释掉#define hypotf hypot4.7)编译core项目成功4.8) 将renderer右键->Properties->Build Events->Post-BuildEvent中的zlib1.dll换成zlibwapi.dll。并将zlibwapi.dll放在解决方案目录下,即win32/目录下。4.9)修改所有项目的Output Directory为../../bin。Intermediate Directory为../tmp/$(ProjectName)/4.10)Build整个解决方案。 5)需要把C:DeployinWin32Release中的所有dll文件拷贝到C:pbrt-v1pbrt-1.05in中,并设定系统变量PBRT_SEARCHPATH指向C:pbrt-v1pbrt-1.05in下载一个测试用的 pbrt 脚本文件,再写个批处理脚本 pbrt.cmd,都放到PBRT 文件夹下的 scenes 文件夹下,来测试下pbrt 程序吧,批处理脚本如下:SET PATH=%PATH%;%PBRT_SEARCHPATH% pbrt.exe sharp.pbrt".....inexrdisplay.exe" sharp.exr  遇到问题及解决方案:1)c:pbrt-v1pbrt-1.05coreexrio.cpp(29):fatal error C1083: Cannot open include file: "ImfInputFile.h": No such file ordirectory在core项目的属性里VC++Directories中的Include Directories中加入:C:Deployinclude2)c:pbrt-v1pbrt-1.05corepbrtlex.cpp(771):fatal error C1083: Cannot open include file: "unistd.h": No such file ordirectory在core目录下新建文件unistd.h。内容如下:#ifndef _UNISTD_H   #define _UNISTD_H   #include <io.h>  #include <process.h>  #endif /* _UNISTD_H */3)c:program files(x86)microsoft visual studio 10.0vcincludemath.h(167): error C2733: secondC linkage of overloaded function "hypot" not allowed解决方法,在exrio.cpp文件中,注释掉#define hypotf hypot4)将core项目右键->Properties->Linker->General->AdditionalLibrary Directories改为C:DeploylibWin32Release5)由于我用的是ZLIB-1.2.5版本,其对应的dll和lib分别为zlibwapi.dll和zlibwapi.lib将core右键->Properties->Linker->AdditionalDependecies,将其改为:Half.libIex.libIlmImf.libImath.libzlibwapi.libIlmThread.lib6)1>exrio.obj : errorLNK2001: unresolved external symbol "private: static union half::uif const* const half::_toFloat" (?_toFloat@half@@0QBTuif@1@B)1>exrio.obj : error LNK2001: unresolved external symbol"private: static unsigned short const * const half::_eLut"(?_eLut@half@@0QBGB)解决方案:在core右键->Properties->C/C++->Preprocessor->PreprocessorDefinition部分加入OPENEXR_DLL7)C:Program Files(x86)MSBuildMicrosoft.Cppv4.0PlatformsWin32Microsoft.Cpp.Win32.Targets(392,5):error MSB6003: The specified task executable "link.exe" could not berun. The process cannot access the file"C:pbrt-v1pbrt-1.05win32ProjectsDebuglink.read.1.tlog" because it is beingused by another process.原因:多个项目将tlog文件输出到同一目录,导致冲突。解决方法:发现所有项目的IntermediateDirectory指定到不同的目录。项目属性->ConfigurationProperties->General->Intermediate Directory。原来为Debug,将其改为../tmp/$(ProjectName)/Ubuntu系统监测工具su 与 sudo的区别相关资讯      PBRT  本文评论 查看全部评论 (1)
表情: 姓名: 字数


评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款