SIZE_MAX не объявляется при попытке собрать opencv-2.4.10 на raspbian wheezy
Я пытаюсь собрать opencv-2.4.10 на моей Raspberry Pi модель B (wheezy), следуя этим инструкциям, но получаю ошибку ниже. Какой лучший способ исправить это?
[ 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
1 ответ
Я не уверен, что это лучший метод, но после попытки исправить, определив __STDC_LIMIT_MACROS, я сдался и отредактировал /usr/include/jasper/jas_math.h, добавив
#if ! defined SIZE_MAX
#define SIZE_MAX (4294967295U)
#endif
сразу после
#include <stdint.h>