我有一个较旧的系统(带有 xcode 4.0 的 OSX 10.6.8),我正在尝试让 OpenCV 2.3.0 运行它。我无法解决的问题是,每当我尝试使用 flann 库时,我的 xcode 都会给我一个 Mach-O 链接器错误。到目前为止,我已经尝试重新编译所有库并从不同的源构建 dylib,但它没有帮助。当我在终端检查图书馆时,我得到
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
我的具体错误代码是:
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)
我与该项目链接的动态库是:
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
我会很感激任何帮助。谢谢!