简体   繁体   English

在C ++的Xcode上安装openCV

[英]Install openCV on xcode for c++

I have problems to install openCV on xcode in order to develop in C++. 为了在C ++中进行开发,我在xcode上安装openCV时遇到问题。 I tried to follow this tutorial 我试图按照本教程

But, I have a problem when I do the make command in the terminal, I have this kind of error: 但是,当我在终端中执行make命令时,我遇到了一个问题:

fatal error: 致命错误:
'QTKit/QTKit.h' file not found 找不到'QTKit / QTKit.h'文件
#import #进口
1 error generated. 产生1个错误。
make[2]: *** 使[2]:***
[modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_qtkit.mm.o] Error 1 [模块/highgui/CMakeFiles/opencv_highgui.dir/src/cap_qtkit.mm.o]错误1

Do you have any solution? 你有什么解决办法吗?

Try to install OpenCV through homebrew. 尝试通过自制软件安装OpenCV。 To do this, open terminal and run the following commands. 为此,请打开终端并运行以下命令。

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 
brew install homebrew/science/opencv3

Last command will install OpenCV3 and all dependencies in /usr/local/Cellar/opencv3/3.1.0.3/ 最后一条命令将在/usr/local/Cellar/opencv3/3.1.0.3/中安装OpenCV3和所有依赖项

Then you can link .dylib and .h/.hpp files to your XCode project and use OpenCV. 然后,您可以将.dylib和.h / .hpp文件链接到XCode项目并使用OpenCV。

If you have any questions, I'm happy to answer them. 如果您有任何疑问,我很乐意回答。

[EDIT]: If you use macOS 10.12 or later, install OpenCV with following commands. [编辑]:如果您使用macOS 10.12或更高版本,请使用以下命令安装OpenCV。

brew install opencv3 --with-ffmpeg --with-tbb --with-contrib
brew reinstall opencv3 --HEAD --with-python3 --with-ffmpeg --with-tbb --with-contrib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM