mmp / pbrt-v3

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
http://pbrt.org
BSD 2-Clause "Simplified" License
4.86k stars 1.18k forks source link

MSVC 14.37 has compilation issue when building `lmfAttribute.cpp` #333

Open SydianAndrewChen opened 4 months ago

SydianAndrewChen commented 4 months ago

I am trying to build from scratch and msvc reported an error when building ImfAttribute.cpp that error C2039: 'binary_function': is not a member of 'std'. @zhiyi1801 cross examined with me and his code using msvc 14.29 is fine. Later I found out that I need to add #include <functional> explicitly in ImfAttribute.cpp to compile successfully. In @zhiyi1801's case class binary_function is defined in xstdef.h.

Tested on Windows 10 | MSVC 14.37.32822 | Visual Studio 2022 | CMake 3.27