问题描述
我正在尝试按照这些说明,但出现以下错误.解决此问题的最佳方法是什么?
I'm trying to build opencv-2.4.10 on my Raspberry Pi model B (wheezy) following these instructions but am getting the error below. What's the best way of fixing this?
[ 14%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.oIn 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 scopemodules/highgui/CMakeFiles/opencv_highgui.dir/build.make:422: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.o' failedmake[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.o] Error 1CMakeFiles/Makefile2:1772: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failedmake[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2Makefile:133: recipe for target 'all' failedmake: *** [all] Error 2
[ 14%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.oIn 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 scopemodules/highgui/CMakeFiles/opencv_highgui.dir/build.make:422: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.o' failedmake[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.o] Error 1CMakeFiles/Makefile2:1772: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failedmake[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2Makefile:133: recipe for target 'all' failedmake: *** [all] Error 2
推荐答案
我不确定它的最佳实践,但是在尝试通过定义__STDC_LIMIT_MACROS进行更正后,我放弃了并编辑了/usr/include/jasper/jas_math.h ,添加
I'm not sure if its best practice but after trying to correct by defining __STDC_LIMIT_MACROS, I gave up and edited /usr/include/jasper/jas_math.h, adding
#if ! defined SIZE_MAX
#define SIZE_MAX (4294967295U)
#endif
紧接着
#include <stdint.h>
这篇关于尝试在Raspbian Wheezy上构建opencv-2.4.10时未声明SIZE_MAX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!