This is yet another quirks of C++ programming I found (and could be very hard to debug).
When you use Windows API (eg: you have #include
Apparently this will cause confusion for the compiler if you’re including another 3rd party library which expects standard library min() and max(). The error message you get is something like this (how obscure is this?):
1>c:mongodbsrcsrcmongodb../bson/bsonelement.h(630): warning C4003: not enough actual parameters for macro 'max' 1>c:mongodbsrcsrcmongodb../bson/bsonelement.h(630): error C2589: '(' : illegal token on right side of '::' 1>c:mongodbsrcsrcmongodb../bson/bsonelement.h(630): error C2059: syntax error : '::' 1>c:mongodbsrcsrcmongodb../bson/bsonelement.h(630): error C2143: syntax error : missing ';' before '{'
To avoid pulling the macros from Windows API, hash define following:
#define NOMINMAX