0

I have problems to install openCV on xcode in order to develop in C++. 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:

fatal error:
'QTKit/QTKit.h' file not found
#import
1 error generated.
make[2]: ***
[modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_qtkit.mm.o] Error 1

Do you have any solution?

1
  • did you checked your pathes? Maybe it comes from there?
    – retinotop
    Nov 21, 2016 at 15:09

1 Answer 1

2

Try to install OpenCV through homebrew. 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/

Then you can link .dylib and .h/.hpp files to your XCode project and use 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.

brew install opencv3 --with-ffmpeg --with-tbb --with-contrib
brew reinstall opencv3 --HEAD --with-python3 --with-ffmpeg --with-tbb --with-contrib
4
  • Thank you for answering. I tried your command but i still have the same error : #import <QTKit/QTKit.h> ^ 1 error generated. Nov 21, 2016 at 16:42
  • @andresouris, which version of macOS do you use?
    – Murad
    Nov 21, 2016 at 16:57
  • I'm using the version 10.12.1 on macOS sierra Nov 21, 2016 at 17:09
  • @andresouris, oh, a few days ago my girlfriend faced your problem and solved it, I'll ask her to respond to you when I get home :)
    – Murad
    Nov 21, 2016 at 18:22

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.