Thursday, May 23, 2013

OpenCV setup for Mac

Homebrew makes setup easy.

This is for OSX 10.7+:
1) Install the latest XCode and its command line tools (must install separately).
2) Install homebrew
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
$ brew doctor
- make any fixes the doctor recommends
$ brew tap hombrew/science
- this gives you access to a group of science-related brew formulas
$ brew install opencv
- will probably install the latest mac-compatible OpenCV; as of this writing, the OpenCV version was 2.4.5

In XCode, if you set the correct Additional Library and Header paths in Build Settings, but still get linker errors when you try to compile OpenCV C++ code, in Build Settings edit the Standard C++ library to choose libstdc++ (GNU C++ standard library) instead.

No comments:

Post a Comment