0
在OpenCV中使用Features2D
時,我一直在爲構建錯誤而戰,我無法弄清楚原因。使用XCode在OpenCV中使用Featured2D構建錯誤
- OpenCV的版本:2.4.3(MacPorts的)
- 編譯拱:64位Intel
- C語言的方言:GNU99
- C++語言方言:GNU ++ 11
- C++標準庫:++的libstdc
生成錯誤:
Undefined symbols for architecture x86_64:
"cv::FeatureDetector::detect(cv::Mat const&, std::__debug::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat const&) const", referenced from:
analysis::openCvStitching() in analysis.o
"cv::DescriptorMatcher::match(cv::Mat const&, cv::Mat const&, std::__debug::vector<cv::DMatch, std::allocator<cv::DMatch> >&, cv::Mat const&) const", referenced from:
analysis::openCvStitching() in analysis.o
"cv::DescriptorExtractor::compute(cv::Mat const&, std::__debug::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat&) const", referenced from:
analysis::openCvStitching() in analysis.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
這是我如何創建一個指向FeatureDetector和DescriptorExtractor:
Ptr<FeatureDetector> surfDetector = FeatureDetector::create(type);
Ptr<DescriptorExtractor> surfExtractor = DescriptorExtractor::create(type);