2

I download opencv-3.0.0.zip and unzip it , then execute:

 #cd opencv-3.0.0/
 #mkdir build
 #cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=./build -D  WITH_IPP=OFF ../opencv-3.0.0
 #make -j8

and it make some error :

 ……

[ 49%] Building CXX object 
modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_jpeg2000.cpp.o
In file included from /usr/include/jasper/jasper.h:77:0,
                 from /home/apps/zhimin.feng/software/opencv-3.0.0/modules/imgcodecs/src/grfmt_jpeg2000.cpp:59:
/usr/include/jasper/jas_math.h: In function ‘bool jas_safe_size_mul(size_t, size_t, size_t*)’:
/usr/include/jasper/jas_math.h:143:15: error: ‘SIZE_MAX’ was not declared in this scope
if (x && y > SIZE_MAX / x) {
           ^
/usr/include/jasper/jas_math.h: In function ‘bool jas_safe_size_add(size_t, size_t, size_t*)’:
/usr/include/jasper/jas_math.h:170:10: error: ‘SIZE_MAX’ was not declared in this scope
 if (y > SIZE_MAX - x) {
      ^
make[2]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_jpeg2000.cpp.o] Error 1
make[1]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

I might have install all the dependency ,but it still occur the error .

2 Answers 2

6

I finally found the answer from

SIZE_MAX not declared when trying to build opencv-2.4.10 on raspbian wheezy

edit /usr/include/jasper/jas_math.h,add

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

after

#include <stdint.h>
2

This is a fail in the yum installed version of jasper. Currently the best thing to do is to downgrade from the updates version released on 15/5/2017 (Release 30.el7) back to the base package version (Release 29.el7)

I've created a ticket here. In the meantime running

sudo yum install jasper-devel-1.900.1-29.el7 instead of sudo yum install jasper-devel should do the trick

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.