繁体   English   中英

使用XCode在OpenCV中使用Feature2D构建错误

[英]Build error using Featured2D in OpenCV with XCode

我在OpenCV中使用Features2D时遇到了构建错误,我无法弄清楚原因。

  • OpenCV版本:2.4.3(MacPorts)
  • 编译arch: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);

您是否尝试从项目设置中的预处理程序标志中删除_GLIBCXX_DEBUG=1和/或_GLIBCXX_DEBUG_PEDANTIC=1 opencv2 c ++ api在API函数中使用STL模板有点不好,如果你的标准库版本或编译器标志与编译时使用的版本不完全匹配,可能会导致链接器错误或崩溃。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM