I have followed this http://www.pyimagesearch.com/2015/06/15/install-opencv-3-0-and-python-2-7-on-osx/ to install OpenCV on my mac. When I do this step : $ make -j4 a problem happened:
fatal error:
'QTKit/QTKit.h' file not found
#import <QTKit/QTKit.h>
^ 1 error generated. make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o]
Error 1 make[1]: ***
[modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make: ***
[all] Error 2
Try building it like this instead:
cmake -DWITH_QUICKTIME=OFF -DWITH_GSTREAMER=OFF -DWITH_FFMPEG=OFF -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_BUILD_TYPE=Release .. ; make -j4
Here is a workaround solution to fix the issue:
MacOSX10.11.sdk/MacOSX10.11.sdk/System/Library/Frameworks/QTKit.framework/Headers/
opencv-3.2.0/modules/highgui/src/QTKit
, and copy all header files into the folder."-DWITH_QUICKTIME=OFF -DWITH_GSTREAMER=OFF -DWITH_FFMPEG=OFF"
This works for opencv2.x and 3.x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With