use homebrew to install opencv
brew install opencv
and in xcode project
add
Header Search Paths: /usr/local/Cellar/opencv/ choose recursive
Library Search Paths: /usr/local/Cellar/opencv/ choose recursive
Other Linker Flags: -lopencv_core -lopencv_highgui -lopencv_imgproc (add other if you want to use other library)
Then you can write your opencv code!
Problem1:
OpenCV Unresolved symbols
Ans: switched the compiler used in the XCode (Apple LLVM 4.1) to the LLVM GCC 4.2 and now it works!
http://stackoverflow.com/questions/13461400/opencv-unresolved-symbols-name-mangling-mismatch-xcode
Ans2:Under Build Settings>Apple LLVM compiler 4.1 - Language>C++ Standard Library: Change from libc++ (LLVM ...) to libstdc++ (GNU C++ ...).
http://stackoverflow.com/questions/12770115/linking-libraries-opencv-2-4-2-on-xcode-4-5-1?rq=1
沒有留言:
張貼留言