728x90
반응형

Program Language/OpenCV 3

error C3861: 'min': identifier not found

1>c:\program files (x86)\windows kits\8.1\include\um\gdiplustypes.h(689): error C3861: 'min': identifier not found 1>c:\program files (x86)\windows kits\8.1\include\um\gdiplustypes.h(690): error C3861: 'min': identifier not found 오랜만에 봐서 살짝 당황했네. MIN, MAX가 중복 선언돼서 문제 되는 건 기억나는데.. 이건 opencv와 Gdiplus의 min, max가 충돌(?) 혹은 선점이 잘못되어서 그런 것 같다. 를 사용하지 않았는데, 이런 에러가 떠다니, opencv.hpp 보다 먼저 인클루드 해주면 된다. #inc..

(OpenCV) LNK2019: unresolved external symbol "class cv::debug_build_guard::_InputOutputArray ....

Error Linking static libraries - OpenCV Q&A Forum Error Linking static libraries edit Hi, I built opencv from source and I'm trying to make a dll that uses some of the opencv .lib. In visual studio I set the additional directory and dependencies as follows (.lib files are in that folder): [...]\lib;%(Addi answers.opencv.org 한참을 헤매다가 debug 프로젝트에서 release 라이브러리를 가져와서 발생한 에러라는 걸 알았다. 그래서 debug 라이브러..

MFC에서 OpenCV 사용 시 메모리 누수 해결

Lib를 만들고 테스트를 하는데 계속해서 메모리 누수가 생겼다. 메모리 누수가 생길 만큼 복잡한 코드도 아닌데 여지없이 발생한다. 특정 Lib을 포함하면 생기고 제거하면 안 생긴다. 그런데 또 그것만 따로 테스트하면 안 생겼다. 귀신이 곡할 노릇. 이래저래 오전을 다 보낸 뒤 OpenCV를 제거하니 모든 것이 정상이 되었다. 이런 경험은 처럼이라 구글링 해보니 그런 경우가 있다고 한다. 이것은 OpenCV 라이브러리가 로딩되는 시점과, MFC 공용 DLL이 로드되는 시점에 충돌이 발생될 수 있다하여 OpenCV lib을 지연 로딩해야 한다는 것이다. 그래서 지연 로딩에 등록 후 실행하니 메모리 누수가 해결되었다. 참 별일이다. 이런 것 해결하는 분들은 엄지척.. ^^

728x90
반응형