The main reason why I previously wrote:
First of all, please provide a full example of what you are trying to do. Previously included headers can affect following headers in C/C++.
is because of what caused this.
Including Windows.h
before manifold/manifold.h
causes this. Having a full code example would have made this much easier to notice.
The code on github shows that at line 1689 is where the definition of the min template function is. This is important because Windows.h
, or specifically minwindef.h
defines the following:
//minwindef.h line 190 in the 10.0.26100.0 SDK.
#ifndef NOMINMAX
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#endif /* NOMINMAX */
So the inclusion of Windows.h
is causing errors in manifold/manifold.h
. Defining NOMINMAX
before including Windows.h
will fix this.
#define NOMINMAX
#include <Windows.h>
#include <manifold/manifold.h>
int wmain()
{
return 0;
}