当在Features2D中使用OpenCV时,我一直在与构建错误作斗争,但我不知道为什么。
生成错误:
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);发布于 2012-12-18 13:05:27
您是否尝试过从项目设置中的预处理器标志中删除_GLIBCXX_DEBUG=1和/或_GLIBCXX_DEBUG_PEDANTIC=1?opencv2 c++ api在使用API函数中的STL模板方面有些糟糕,如果标准库或编译器标志的版本与编译时使用的不完全匹配,则可能会导致链接器错误或崩溃。
https://stackoverflow.com/questions/13933513
复制相似问题