1

我正在尝试按照这些说明在我的 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

4

1 回答 1

4

我不确定它是否是最佳实践,但在尝试通过定义 __STDC_LIMIT_MACROS 进行纠正后,我放弃并编辑了 /usr/include/jasper/jas_math.h,添加

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

紧接着

#include <stdint.h>
于 2017-02-07T18:46:15.550 回答