![](/img/trans.png)
[英]xcode build error with undefined symbols using aruco opencv module in Xcode
[英]Build error using Featured2D in OpenCV with XCode
我在OpenCV中使用Features2D
时遇到了构建错误,我无法弄清楚原因。
构建错误:
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.