环境:MacOS 10.12,CMake 3.9.0,python 2.7
我尝试使用此tutorial在mac上编译Opencv当我按照步骤8
时$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local \
-D PYTHON2_PACKAGES_PATH=~/.virtualenvs/cv/lib/python2.7/site-packages \
-D PYTHON2_LIBRARY=/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/bin \
-D PYTHON2_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Headers \
-D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules ..
$ make -j4
我收到了以下信息
/Users/niceycb/opencv/modules/videoio/src/cap_qtkit.mm:46:9: 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[1]: *** Waiting for unfinished jobs....
[ 35%] Linking CXX static library ../../lib/libopencv_shape.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../lib/libopencv_shape.a(precomp.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../lib/libopencv_shape.a(precomp.cpp.o) has no symbols
[ 35%] Built target opencv_shape
make: *** [all] Error 2
第一个错误是已知问题(因为在OS X v10.9中不推荐使用QuickTime Kit,我的MacBook版本:10.12)并且我已经遵循了几个解决方案,但没有一个工作。
我不知道第二个错误,似乎没有解决方案。