pbrt question about unresolved external symbol

154 views Asked by At

Recently, I am stduying pbrt(physically based rendering). However, I have a question in using it in VS2019. I have cmaked the pbrt system(using the command "git clone --recursive https://github.com/mmp/pbrt-v3/"), and included it in VS. After I have written a simple test codes:

#define GOOGLE_GLOG_DLL_DECL
#include "core\pbrt.h"
#include "core\geometry.h"
#include "core\transform.h"
#include <iostream>
using namespace pbrt;
int main() {
    Transform T = Scale(2,3,5);
    pbrt::Vector3f a(1, 1, 1);
    pbrt::Vector3f b(2, 1, 1);
    pbrt::Vector3f c = a + b;
    pbrt::Point3f p0(0, 0, 0);
    pbrt::Ray r(p0, a);
    std::cout << r << std::endl;
}

the VS2019 gives lot of unresolved external symbol errors, which I did not show all of them here:

Severity Code Description Project File Line Suppression State Error LNK2001 unresolved external symbol "int __cdecl Imf::globalThreadCount(void)" (?globalThreadCount@Imf@@YAHXZ) PBRT E:\PBRT\PBRT\libpbrt.lib(imageio.obj) 1

Severity Code Description Project File Line Suppression State Error LNK2001 unresolved external symbol "public: __cdecl Imf::RgbaOutputFile::RgbaOutputFile(char const * const,class Imath::Box<class Imath::Vec2 > const &,class Imath::Box<class Imath::Vec2 > const &,enum Imf::RgbaChannels,float,class Imath::Vec2,float,enum Imf::LineOrder,enum Imf::Compression,int)" (??0RgbaOutputFile@Imf@@QEAA@QEBDAEBV?$Box@V?$Vec2@H@Imath@@@Imath@@1W4RgbaChannels@1@MV?$Vec2@M@3@MW4LineOrder@1@W4Compression@1@H@Z) PBRT E:\PBRT\PBRT\libpbrt.lib(imageio.obj) 1

Severity Code Description Project File Line Suppression State Error LNK2001 unresolved external symbol "public: virtual __cdecl Imf::RgbaOutputFile::~RgbaOutputFile(void)" (??1RgbaOutputFile@Imf@@UEAA@XZ) PBRT E:\PBRT\PBRT\libpbrt.lib(imageio.obj) 1

Severity Code Description Project File Line Suppression State Error LNK2001 unresolved external symbol "public: void __cdecl Imf::RgbaOutputFile::setFrameBuffer(struct Imf::Rgba const *,unsigned __int64,unsigned __int64)" (?setFrameBuffer@RgbaOutputFile@Imf@@QEAAXPEBURgba@2@_K1@Z) PBRT E:\PBRT\PBRT\libpbrt.lib(imageio.obj) 1

Severity Code Description Project File Line Suppression State Error LNK2001 unresolved external symbol "public: class Imath::Box<class Imath::Vec2 > const & __cdecl Imf::RgbaInputFile::displayWindow(void)const " (?displayWindow@RgbaInputFile@Imf@@QEBAAEBV?$Box@V?$Vec2@H@Imath@@@Imath@@XZ) PBRT E:\PBRT\PBRT\libpbrt.lib(imageio.obj) 1

Severity Code Description Project File Line Suppression State Error LNK2001 unresolved external symbol inflate PBRT E:\PBRT\PBRT\Ptex.lib(PtexReader.obj) 1

Severity Code Description Project File Line Suppression State Error LNK2001 unresolved external symbol inflateEnd PBRT E:\PBRT\PBRT\Ptex.lib(PtexReader.obj) 1

Severity Code Description Project File Line Suppression State Error LNK1120 15 unresolved externals PBRT E:\PBRT\x64\Release\PBRT.exe 1

What is wrong with pbrt? I think I did not do anthing wrong when cmake, and what I sopposed to do now? Thank you very much for answering this question.

0

There are 0 answers