CentOS6.5安装Opencv3.1的‘SIZE_MAX’ was not declared in this scope异常处理

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chwshuang/article/details/77192146

CentOS6.5安装Opencv3.1的‘SIZE_MAX’ was not declared in this scope异常处理

项目中用到人脸识别,使用opencv的库文件,所以在安装过程中需要安装opencv。
刚开始是在CentOS5.4上安装的,结果发现opencv还没装,依赖库cmake就安装失败了。

‘SIZE_MAX’ was not declared in this scope
[ 52%] Building CXX object modules/photo/CMakeFiles/opencv_photo.dir/src/denoising.cuda.cpp.o
In file included from /usr/include/jasper/jasper.h:77,
                 from /usr/local/opencv-3.1.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: error: ‘SIZE_MAX’ was not declared in this scope
/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: error: ‘SIZE_MAX’ was not declared in this scope
make[2]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_jpeg2000.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 53%] Building CXX object modules/photo/CMakeFiles/opencv_photo.dir/src/tonemap.cpp.o
[ 53%] Building CXX object modules/photo/CMakeFiles/opencv_photo.dir/src/seamless_cloning.cpp.o
[ 53%] Building CXX object modules/photo/CMakeFiles/opencv_photo.dir/src/hdr_common.cpp.o
[ 53%] Building CXX object modules/photo/CMakeFiles/opencv_photo.dir/src/denoising.cpp.o
[ 53%] Building CXX object modules/video/CMakeFiles/opencv_video.dir/src/optflowgf.cpp.o
[ 53%] Building CXX object modules/video/CMakeFiles/opencv_video.dir/opencl_kernels_video.cpp.o
make[1]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 53%] Building CXX object modules/photo/CMakeFiles/opencv_photo.dir/opencl_kernels_photo.cpp.o
In file included from /usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:45:
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<short unsigned int, 4>, IT = long int, UIT = long unsigned int, D = DistAbs, WT = cv::Vec<int, 4>]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<short unsigned int, 4>, IT = long int, UIT = long unsigned int, D = DistAbs, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<short unsigned int, 3>, IT = long int, UIT = long unsigned int, D = DistAbs, WT = cv::Vec<int, 3>]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<short unsigned int, 3>, IT = long int, UIT = long unsigned int, D = DistAbs, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<short unsigned int, 2>, IT = long int, UIT = long unsigned int, D = DistAbs, WT = cv::Vec<int, 2>]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<short unsigned int, 2>, IT = long int, UIT = long unsigned int, D = DistAbs, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = unsigned char, IT = long int, UIT = long unsigned int, D = DistAbs, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 4>, IT = int, UIT = unsigned int, D = DistAbs, WT = cv::Vec<int, 4>]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 4>, IT = int, UIT = unsigned int, D = DistAbs, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 3>, IT = int, UIT = unsigned int, D = DistAbs, WT = cv::Vec<int, 3>]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 3>, IT = int, UIT = unsigned int, D = DistAbs, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 2>, IT = int, UIT = unsigned int, D = DistAbs, WT = cv::Vec<int, 2>]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 2>, IT = int, UIT = unsigned int, D = DistAbs, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = unsigned char, IT = int, UIT = unsigned int, D = DistAbs, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 4>, IT = int, UIT = unsigned int, D = DistSquared, WT = cv::Vec<int, 4>]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 4>, IT = int, UIT = unsigned int, D = DistSquared, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 3>, IT = int, UIT = unsigned int, D = DistSquared, WT = cv::Vec<int, 3>]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 3>, IT = int, UIT = unsigned int, D = DistSquared, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 2>, IT = int, UIT = unsigned int, D = DistSquared, WT = cv::Vec<int, 2>]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = cv::Vec<unsigned char, 2>, IT = int, UIT = unsigned int, D = DistSquared, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp: In member function ‘void FastNlMeansMultiDenoisingInvoker<T, IT, UIT, D, WT>::operator()(const cv::Range&) const [with T = unsigned char, IT = int, UIT = unsigned int, D = DistSquared, WT = int]’:
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:247: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/local/opencv-3.1.0/modules/photo/src/denoising.cpp:433:   instantiated from here
/usr/local/opencv-3.1.0/modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp:249: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Linking CXX static library ../../lib/libopencv_video.a
[ 53%] Built target opencv_video
Linking CXX static library ../../lib/libopencv_photo.a
[ 53%] Built target opencv_photo
make: *** [all] Error 2
[root@bj-s-14-v10 build]#

这个提示是指在

/usr/include/jasper/jas_math.h

文件中缺少SIZE_MAX 的定义,需要我们在这个文件#include <stdint.h> 下一行中加入

#include <stdbool.h>
#include <stdint.h>

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

意思就是没有定义SIZE_MAX 的时候,定义SIZE_MAX4294967295U

然后清空build目录,重新配置,重新make

猜你喜欢

转载自blog.csdn.net/chwshuang/article/details/77192146
今日推荐