1
votes

I installed OpenCV 3.2.0-dev on my mac(10.12) using Homebrew following this instruction http://www.pyimagesearch.com/2015/06/15/install-opencv-3-0-and-python-2-7-on-osx/.

I solved the QTKit.h problem by skipping the checkout step.

Then I tried to build a small c++ program in Xcode 8 because I'm more familiar with c++ than python, it gave me an Apple mach-O linker (id) error which is shown here: error message screenshot

The search paths for header and library are /usr/local/include and /usr/local/lib respectively. And the linker flags are

-lopencv_calib3d -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videoio -lopencv_videostab

And I know when I use OpenCV version later than 3.1(I think), the linker flags can be replaced by something like opencv_world310.lib. Is there a similar way in Xcode?

Anyone can help me with that?

1

1 Answers

1
votes

Homebrew install opencv in /usr/local/Cellar/, not in /usr/local/. So you need to modify header and library search paths correspondingly.