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? Commented 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
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for answering. I tried your command but i still have the same error : #import <QTKit/QTKit.h> ^ 1 error generated.
@andresouris, which version of macOS do you use?
I'm using the version 10.12.1 on macOS sierra
@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 :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.