我试图在these instructions之后在我的Raspberry Pi模型B(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
答案 0 :(得分:4)
我不确定它是否是最佳做法,但在通过定义__STDC_LIMIT_MACROS尝试纠正之后,我放弃并编辑了/usr/include/jasper/jas_math.h,添加了
#if ! defined SIZE_MAX
#define SIZE_MAX (4294967295U)
#endif
之后
#include <stdint.h>