Ask Your Question

Revision history [back]

OpenCV-3.3.1 installation error on Mac

I download the source code of OpenCV 3.3.1 release version from github to my MacOS X EI Capitan 10.11.6. Then I execute:

 cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/Users/yan/opencv-src/opencv-3.3.1/build \
-D OPENCV_EXTRA_MODULES_PATH=/Users/yan/opencv-src/opencv_contrib-3.3.1/modules \
-D PYTHON3_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6.dylib \
-D PYTHON3_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m/ \
-D PYTHON3_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 \
-D BUILD_opencv_python3=ON \
-D BUILD_opencv_python2=OFF \
-D WITH_CUDA=OFF \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=ON ..

and copy opencv.pc to /usrlocal/lib/pkgconfig/opencv3.pc and run test command:

g++ -ggdb `pkg-config --cflags --libs opencv3` opencv_version.cpp -o /tmp/test && /tmp/test

an library not found error:

ld: library not found for -llibopencv_stitching.3.3.1.dylib
clang: error: linker command failed with exit code 1 (use -v to see invocation)