diff --git a/Eigen/Core b/Eigen/Core index 7f42a6c29..211e0f9c7 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -69,6 +69,13 @@ #include #endif +// this needs to be done after all possible windows C header includes and before any Eigen source includes +// (system C++ includes are supposed to be able to deal with this already): +// windows.h defines min and max macros which would make Eigen fail to compile. +#if defined(min) || defined(max) +#error The preprocessor symbols 'min' or 'max' are defined. If you are compiling on Windows, do #define NOMINMAX to prevent windows.h from defining these symbols. +#endif + namespace Eigen { /** \defgroup Core_Module Core module