安opencv报错,o

本文首要讲点儿宗工作:

问题:make[2]: ***
[modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg2000.cpp.o]
错误 1[ 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

用homebrew安装opencv

 错误原因: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后添加

解决macOS sierra10.12,安装opencv报错:QTKIT/QTKIT.h file

#ifndef SIZE_MAX


#define SIZE_MAX (4294967295U)

## 用homebrew 安装opencv

#endif

其一本文就背着了吧!到处都是!

(不得不吐槽一下华夏之博客,搜索了20几近只博客全体都是一摸一样的解决方案问题是还无克缓解问题。)

## 解决安装opencv报错

故homebrew安装opencv3,结果编译报错。下面贴有报错的make命令。

[ 66%] Built target
opencv_photo/tmp/opencv3-20161011-39738-1h8e3c8/opencv-3.1.0/modules/videoio/src/cap_qtkit.mm:46:9:
fatal error: ‘QTKit/QTKit.h’ file not found#import

^1 error generated.make[2]: ***
[modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o]
Error 1make[2]: *** Waiting for unfinished jobs….make[1]:
*** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error
2make: *** [all] Error 2

自地点可以见见问题在 ‘QT基特.h’ file not found.

lovebet,乃找了一样旗,发现多数博客提议的缓解方案是

从未有过升级到10.12之mac中复制QT基特.framework

唯独这种艺术只有会是徒劳无益,从osx系统自身来说破坏了系统的闭环,前面会招致系统紊乱。其实要的来头是:Apple的API
Reference QT基特(Kit) 提到OS X
v10.9继底网针对QT基特(Kit).framework将不开支撑,替代框架为AVFoundation .

最终到opencv和homebrew/science找寻来无有人提出issue和呼应大神的化解方案。结果真找到了
在opencv下边pull request #7266
已经统一,那些merge已经是风靡的本,表明有或已把qtkit.framework代替为了AVFoundation

铛铛铛!!

Brew下面有一个限令`

–HEAD    Install HEAD version

意就是是装上添加—HEAD就可以装和眼前系统配合的master版本。

brew install opencv3 –HEAD

然后您要举办的哪怕是喝杯!完成了。

==> Summary  /usr/local/Cellar/opencv3/HEAD-73a8fa8_4: 285 files,
46.4M, built in 31 minutes 5 seconds