I am having a rough time installing OpenCV on mac(OS X 10.8.4) and xcode 4.6.3.
I have tried Macports and Homebrew for the same and failed and not even close anywhere to run it. Error usually is 'Error: Failed to install bzip2' or 'Error: Processing of port opencv failed'. I am behind a proxy and that might be a problem.
The easiest and most close method to completion was is: Using Cmake and then OpenCV to install using terminal. Then using xcode as shown at http://sadeepj.blogspot.in/2012/03/installing-and-configuring-opencv-to.html but the problem is occurred while building project in xcode I set the value of Header Search Paths to /usr/local/include and even added these 2 files 'libopencv_core.2.4.5.dylib & libopencv_highgui.2.4.5.dylib' to project.
Main.cpp file
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main (int argc, const char * argv[])
{
Mat img = imread("/Users/mhtgwl/Desktop/baba.jpg"); //Change the image path here.
if (img.data == 0) {
cerr << "Image not found!" << endl;
return -1;
}
namedWindow("image", CV_WINDOW_AUTOSIZE);
imshow("image", img);
waitKey();
}
The error is "ld: library not found for -lopencv_core.2.4.5 clang: error: linker command failed with exit code 1 (use -v to see invocation)" and I have tried changing OS target version and changing library search path to /usr/local/include but it does not help.