darknet Visual Studio 2015, Debug Build 시에...
cvdef.h 59번째 줄입니다.
>c:\opencv331\build\include\opencv2\core\cvdef.h(58): error C2061: 구문 오류: 식별자 'cv'
1>c:\opencv331\build\include\opencv2\core\cvdef.h(58): error C2059: 구문 오류: ';'
1>c:\opencv331\build\include\opencv2\core\cvdef.h(58): error C2449: 파일 범위에 '{'가 있습니다. 함수 헤더가 없는 것 같습니다.
1>c:\opencv331\build\include\opencv2\core\cvdef.h(58): error C2059: 구문 오류: '}'
1>c:\opencv331\build\include\opencv2\core\types_c.h(929): warning C4013: 'cvRound'이(가) 정의되지 않았습니다. extern은 int형을 반환하는 것으로 간주합니다.
이 오류의 원인은, opencv를 application을 debug build하면서 opencv_world.lib랑 링크하면 프로그램이 비정상 동작하는 걸 막기 위해 수정된 내용 때문이다.
이 수정 내용이 .c 파일을 빌드할 때 문제를 일으킨다.(.cpp에서는 문제 없음)
따라서 아래처럼 수정해주면 끝.
#if !defined CV_DOXYGEN && !defined CV_IGNORE_DEBUG_BUILD_GUARD
#if (defined(_MSC_VER) && (defined(DEBUG) || defined(_DEBUG))) || \
(defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_DEBUG_PEDANTIC))
// Guard to prevent using of binary incompatible binaries / runtimes
// https://github.com/opencv/opencv/pull/9161
#define CV__DEBUG_NS_BEGIN namespace debug_build_guard {
#define CV__DEBUG_NS_END }
#ifdef __cplusplus
namespace cv { namespace debug_build_guard { } using namespace debug_build_guard; }
#endif
#endif
#endif
관련 정보 :
'TensorFlow OpenCV' 카테고리의 다른 글
Tensorflow로 faceswap을 해보자 (0) | 2019.10.05 |
---|---|
Windows GDI와 OPENCV 혼용, PolyBezier + Mat 2018. 1. 16. (0) | 2019.10.05 |
마이크로 소프트의 CNTK 설치할 때 환경 변수 지정. 2017. 12. 1. 10:48 (0) | 2019.10.05 |
PyCharm, Tensorflow, Keras 설치 2017. 11. 25. (0) | 2019.10.05 |
tensorflow 타코트론~ 핫핫핫. 잘 안 됩니다. 후히히 2017. 11. 19. (0) | 2019.10.05 |