Ask Your Question

Errors on compiling OpenCV on MacOS Sierra

asked 2016-10-12 14:00:22 -0500

LDG gravatar image

Good evening guys,

I am having an error when I execute the command

make -j4

on my terminal. The error is the following:

/Users/lucadigiammarino/opencv/modules/videoio/src/ fatal error: 'QTKit/QTKit.h' file not found
#import <QTKit/QTKit.h>
1 error generated.
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2

I have been following this tutorial in order to get OpenCV 3.1.0 with Python on my Mac.

This is what I execute in order to configure the build:

    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D PYTHON3_PACKAGES_PATH=~/.virtualenvs/cv3/lib/python3.4/site-packages \
    -D PYTHON3_LIBRARY=/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/libpython3.4m.dylib \
    -D PYTHON3_INCLUDE_DIR=/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/include/python3.4m \
    -D BUILD_opencv_python3=ON \
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules ..

Thank you for your help.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2016-10-12 14:10:40 -0500

x10s gravatar image

Clone the opencv repo to a new folder and don't do the checkout step i.e.

git checkout 3.0.0

The rest of the steps can be followed as mentioned in the link. This means you will be working with the dev branch instead of the release branch. The dev branch has the fix.

edit flag offensive delete link more


I missed this but I hope you skipped checking out the release branch for opencv_contrib as well. They need to be the same version.

x10s gravatar imagex10s ( 2016-10-12 15:06:35 -0500 )edit

Yes, thanks anyway for your quick reply!

LDG gravatar imageLDG ( 2016-10-12 15:19:00 -0500 )edit

YES, It works! thanks very much!

chowchung gravatar imagechowchung ( 2016-11-09 17:27:20 -0500 )edit
Login/Signup to Answer

Question Tools



Asked: 2016-10-12 14:00:22 -0500

Seen: 1,372 times

Last updated: Oct 12 '16