On Sat, Nov 10, 2007 at 08:53:29PM +0100, Uwe Stöhr wrote:
> Andre Poenitz schrieb:
>
>> Windows?
>> Try  #undef max  after the last #include in that file.
>
> This doesn't help, but I found now the problem:
>
> You added in r21492 this code to FileName.cpp:
>
> #if defined (BOOST_WINDOWS)
> # define WIN32_LEAN_AND_MEAN
> # include <windows.h>
> #endif

This was moved in from somewhere else.

> But this redefines the max command:
>
> The Standard Library defines the two template functions std::min() and 
> std::max() in the <algorithm> header. In general, you should use these 
> template functions for calculating the min and max values of a pair. 
> Unfortunately, Visual C++ does not define these function templates. This is 
> because the names min and max clash with the traditional min and max macros 
> defined in <windows.h>. As a workaround, Visual C++ defines two alternative 
> templates with identical functionality called _cpp_min() and _cpp_max(). 
> You can use them instead of std::min() and std::max().To disable the 
> generation of the min and max macros in Visual C++, #define NOMINMAX before 
> #including <windows.h>.
> (from http://www.devx.com/tips/Tip/14540)

> When I change it to:
>
> #if defined (BOOST_WINDOWS)
> # define WIN32_LEAN_AND_MEAN
> # define NOMINMAX
> # include <windows.h>
> #endif
>
> I can compile it. OK to commit this?

I think 

#undef min
#undef max

after #include <windows.h> is still prefered.

Andre'

Reply via email to