You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot build tests because of the inclusion of Windows.h that is known to define the min() and max() macros.
For example, in the file swept_sphere_radius.cpp, there's the following inclusion: #include <boost/test/included/unit_test.hpp>
that will eventually lead to the inclusion of the file boost\test\utils\setcolor.hpp which itself contains (line ~31 with Boost 1.84):
#ifdef _WIN32
#include <windows.h>
During compilation, Visual Studio 2019 complains that max needs more arguments:
1>C:\Users\lolo\Devs\Coal\coal\test\swept_sphere_radius.cpp(310,68): warning C4003: not enough arguments for function-like macro invocation 'max'
1>C:\Users\lolo\Devs\Coal\coal\test\swept_sphere_radius.cpp(191,1): error C2589: '(': illegal token on right side of '::'
I suggest to add these lines in each test file that may be affected:
#define NOMINMAX // <-- adding this line
#define WIN32_LEAN_AND_MEAN // <-- not mandatory but should speed-up compilation
#define BOOST_TEST_MODULE COAL_SWEPT_SPHERE_RADIUS
#include <boost/test/included/unit_test.hpp>
As a side note, I recommend to define WIN32_LEAN_AND_MEAN in utility.h (I added guards against redefinitions):
I cannot build tests because of the inclusion of
Windows.h
that is known to define themin()
andmax()
macros.For example, in the file
swept_sphere_radius.cpp
, there's the following inclusion:#include <boost/test/included/unit_test.hpp>
that will eventually lead to the inclusion of the file
boost\test\utils\setcolor.hpp
which itself contains (line ~31 with Boost 1.84):During compilation, Visual Studio 2019 complains that
max
needs more arguments:I suggest to add these lines in each test file that may be affected:
As a side note, I recommend to define
WIN32_LEAN_AND_MEAN
inutility.h
(I added guards against redefinitions):The text was updated successfully, but these errors were encountered: