首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Featured2D在OpenCV中使用XCode生成错误

使用Featured2D在OpenCV中使用XCode生成错误
EN

Stack Overflow用户
提问于 2012-12-18 12:54:19
回答 1查看 658关注 0票数 1

当在Features2D中使用OpenCV时,我一直在与构建错误作斗争,但我不知道为什么。

  • OpenCV版本: 2.4.3 (MacPorts)
  • 编译arch: 64位英特尔
  • C语言方言: GNU99
  • C++语言方言: GNU++11
  • C++标准库: libstdc++

生成错误:

代码语言:javascript
复制
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的指针:

代码语言:javascript
复制
Ptr<FeatureDetector> surfDetector = FeatureDetector::create(type);
Ptr<DescriptorExtractor> surfExtractor = DescriptorExtractor::create(type);
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-12-18 13:05:27

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

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13933513

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档