I have an older system (OSX 10.6.8 with xcode 4.0) and I'm trying to get OpenCV 2.3.0 to work on it. The problem that I can't resolve is that whenever I try to use the flann library, my xcode gives me a Mach-O linker error. So far I've tried recompiling the all the libraries and building the dylib from a different source, but it hasn't helped. When I check the library in terminal, i get
Freddi-2:OpenCV-2.3.0 fredchen$ file /usr/local/lib/libopencv_flann.dylib
/usr/local/lib/libopencv_flann.dylib: Mach-O 64-bit dynamically linked shared library x86_64
My specific error code is:
Undefined symbols for architecture x86_64:
"cv::flann::KDTreeIndexParams::KDTreeIndexParams(int)", referenced from:
_main in main.o
"cv::flann::SearchParams::SearchParams(int, float, bool)", referenced from:
_main in main.o
"cv::FlannBasedMatcher::FlannBasedMatcher(cv::Ptr<cv::flann::IndexParams> const&, cv::Ptr<cv::flann::SearchParams> const&)", referenced from:
_main in main.o
"cv::BFMatcher::BFMatcher(int, bool)", referenced from:
_main in main.o
"cv::flann::IndexParams::~IndexParams()", referenced from:
cv::flann::SearchParams::~SearchParams() in main.o
"cv::flann::IndexParams::~IndexParams()", referenced from:
cv::Ptr<cv::flann::IndexParams>::delete_obj() in main.o
"vtable for cv::BFMatcher", referenced from:
cv::BFMatcher::~BFMatcher() in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The dynamic libraries I have linked with the project are:
libopencv_video.2.3.0.dylib
libopencv_objdetect.2.3.0.dylib
libopencv_ml.2.3.0.dylib
libopencv_legacy.2.3.0.dylib
libopencv_gpu.2.3.0.dylib
libopencv_contrib.2.3.0.dylib
libopencv_ts.2.3.0.dylib
libopencv_imgproc.2.3.0.dylib
libopencv_highgui.2.3.0.dylib
libopencv_flann.2.3.0.dylib
libopencv_features2d.2.3.0.dylib
libopencv_core.2.3.0.dylib
libopencv_calib3d.2.3.0.dylib
I'd appreciate any help. Thanks!