From 456e88a8a424d66e839158babcda2b8380d1cc79 Mon Sep 17 00:00:00 2001 From: Yuriy Obukh Date: Thu, 18 Jun 2020 14:31:11 +0300 Subject: [PATCH] fix VS Windows build with eigen. https://github.com/opencv/opencv/issues/17548 --- modules/core/include/opencv2/core/eigen.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/core/include/opencv2/core/eigen.hpp b/modules/core/include/opencv2/core/eigen.hpp index 3d7ba8fa14..3f4be931e6 100644 --- a/modules/core/include/opencv2/core/eigen.hpp +++ b/modules/core/include/opencv2/core/eigen.hpp @@ -51,18 +51,19 @@ #include "opencv2/core.hpp" -#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 \ - && defined(CV_CXX11) && defined(CV_CXX_STD_ARRAY) -#include -#define OPENCV_EIGEN_TENSOR_SUPPORT -#endif // EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 - #if defined _MSC_VER && _MSC_VER >= 1200 +#define NOMINMAX // fix https://github.com/opencv/opencv/issues/17548 #pragma warning( disable: 4714 ) //__forceinline is not inlined #pragma warning( disable: 4127 ) //conditional expression is constant #pragma warning( disable: 4244 ) //conversion from '__int64' to 'int', possible loss of data #endif +#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 \ + && defined(CV_CXX11) && defined(CV_CXX_STD_ARRAY) +#include +#define OPENCV_EIGEN_TENSOR_SUPPORT +#endif // EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 + namespace cv {