centos7.0安装opencv出现问题

问题描述:

[ 17%] 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 /usr/local/opencv-2.4.9/modules/highgui/src/grfmt_jpeg2000.cpp:58:
/usr/include/jasper/jas_math.h: 在函数‘bool jas_safe_size_mul(size_t, size_t, size_t*)’中:
/usr/include/jasper/jas_math.h:143:15: 错误:‘SIZE_MAX’在此作用域中尚未声明
  if (x && y > SIZE_MAX / x) {
               ^
/usr/include/jasper/jas_math.h: 在函数‘bool jas_safe_size_add(size_t, size_t, size_t*)’中:
/usr/include/jasper/jas_math.h:170:10: 错误:‘SIZE_MAX’在此作用域中尚未声明
  if (y > SIZE_MAX - x) {
          ^
在全局域:
cc1plus: 警告:无法识别的命令行选项“-Wno-unnamed-type-template-args” [默认启用]
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.o] 错误 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] 错误 2
make: *** [all] 错误 2

错误原因:2017年5月15日,centos更新了jaspe-devel包为jasper-devel.x86_64 0:1.900.1-30.el7_3(旧版本为jasper-devel-1.900.1-29.el7.x86_64)
解决方案:
vi /usr/include/jasper/jas_math.h
#在 #include <stdint.h> 后添加
#ifndef SIZE_MAX
#define SIZE_MAX (4294967295U)
#endif

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值