'C2589'에 해당되는 글 1건

  1. 2015.06.10 OpenCV 3.0 extra module C2589: '(': token not valid to the right error

http://answers.opencv.org/question/62107/erfiltercpp-nfa-method/

OpenCV v3.0 컴파일 진행중에...

OpenCV\opencv_contrib\modules\text\src\erfilter.cpp  파일에서,

p = std::numeric_limits<double>::min();


C2589: '(': token not valid to the right '::'

이런 에러가 나오고 멈춘다.


http://answers.opencv.org/question/62107/erfiltercpp-nfa-method/

min() 이 부분이 

minwindef.h
#define min(a,b)            (((a) < (b)) ? (a) : (b))

위와 같이 연결되니까, 당연히 (a,b)가 없다고 에러가 나올수 밖에.


Solution :

(1) OpenCV\opencv_contrib\modules\text\src\precomp.hpp 파일안에,

// added by Michael : 2015-06-10

#if defined WIN32 || defined WINCE

    #if !defined _WIN32_WINNT

        #ifdef HAVE_MSMF

            #define _WIN32_WINNT 0x0600 // Windows Vista

        #else

            #define _WIN32_WINNT 0x0500 // Windows 2000

        #endif

    #endif


    #include <windows.h>

    #undef small

    #undef min

    #undef max

    #undef abs

#endif

제일 아래쪽에 위 코드 추가한다.
즉, window.h 추가하고나서, #undef min 을 해버리면 된다.



(2) 번째 방법은, 
#NOMINMAX
#include <windows.h>

windows.h 추가하기 전에 #NOMINMAX 해버리면, min, max 정의하지 않으므로 OK


-끝.

1 

글 보관함

카운터

Total : / Today : / Yesterday :
get rsstistory!