2017-01-28 3 views
1

these instructions 다음에 나오는 Raspberry Pi 모델 B (wheezy)에서 opencv-2.4.10을 빌드하려고하는데 아래 오류가 나타납니다. 이것을 고치는 가장 좋은 방법은 무엇입니까? 그 가장 좋은 방법은 있지만 __STDC_LIMIT_MACROS을 정의하여 해결하기 위해 시도한 후, 나는 포기하고 /usr/include/jasper/jas_math.h을 편집 한 경우SIZE_MAX가 raspbian wheezy에서 opencv-2.4.10을 빌드하려고 할 때 선언되지 않았습니다.

[ 14%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.o In file included from /usr/include/jasper/jasper.h:77:0, from /home/pi/opencv-2.4.10/modules/highgui/src/grfmt_jpeg2000.cpp:58: /usr/include/jasper/jas_math.h: In function ‘int jas_safe_size_mul(size_t, size_t, size_t*)’: /usr/include/jasper/jas_math.h:117:22: error: ‘SIZE_MAX’ was not declared in this scope modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:422: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.o' failed make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.o] Error 1 CMakeFiles/Makefile2:1772: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2 Makefile:133: recipe for target 'all' failed make: *** [all] Error 2

답변

4

나는 추가, 확실하지 않다

#if ! defined SIZE_MAX 
#define SIZE_MAX (4294967295U) 
#endif 

바로 다음에

#include <stdint.h> 
+0

문제의 루트 (가정 된 오픈 소스)를 다시 제출하는 것이 가장 좋은 방법은 아닙니다. 그러나 나는 그것을 일반적인 관행으로 인정한다 :-) – Gavin

+0

그것은 좋은 방법이 아니다. [C89에서 SIZE_MAX를 얻는 방법] (https://stackoverflow.com/q/44401965/995714) –