Closed trevordblack closed 3 years ago
Following along with the discussion on this board: https://social.msdn.microsoft.com/Forums/vstudio/en-US/17814e4a-e997-4f28-9878-6cd8303e390d/visual-studio-is-fine-with-stdmax-unless-its-in-one-particular-static-library
I made a small change to float.h
:
// pbrt is Copyright(c) 1998-2020 Matt Pharr, Wenzel Jakob, and Greg Humphreys.
// The pbrt source code is licensed under the Apache License, Version 2.0.
// SPDX: Apache-2.0
#ifndef PBRT_UTIL_FLOAT_H
#define PBRT_UTIL_FLOAT_H
#include <pbrt/pbrt.h>
#include <pbrt/util/pstd.h>
#include <algorithm> // this is new
#include <cmath>
#include <cstdint>
#include <cstring>
#include <limits>
#include <string>
The code now compiles without error.
There are additional suggestions at https://stackoverflow.com/questions/2789481/problem-calling-stdmax that may provide a more robust, long-term solution (if this ends up being a consistent problem)
Thanks for reporting this! I've fixed that as well as some other headers that were sloppy about using things in <algorithm>
without including it, happening to get the definitions because one of their other #include
s had it included...
Ran into a problem compiling pbrt.exe on:
Optix 7.3 and Visual Studio 2019.
Where the problem is:
git blame
says that that specific part of the codebase hasn't been changed since October of last year.Given the combinatorial explosion of OS, cuda, OptiX, and compiler, it's possible that this will be a problem unique to me, but I'm documenting it here for anyone in the future.