i recently added:
#define NOMINMAX
#include
#include
to my main.cpp in order to use
st
It's likely that your problem is that you #define NOMINMAX
after you #include "windows.h"
. It is important that the #define
come first.
The reason is that windows.h (actually I think windef.h, which is included by windows.h) has code similar to this:
#ifndef NOMINMAX
#define min(x,y) ((x) < (y) ? (x) : (y))
#define max(x,y) ((x) > (y) ? (x) : (y))
#endif
So #define NOMINMAX
is telling the compiler (or actually the preprocessor) to skip over the definitions of min
and max
, but it will only apply if you do it before you #include "windows.h"
.