使用 OpenCV 中的 Featured2D 和 XCode 构建错误
Build error using Featured2D in OpenCV with XCode
在OpenCV中使用Features2D
时,我一直在与构建错误作斗争,我不知道为什么。
- OpenCV 版本: 2.4.3 (MacPorts)
- 编译架构:64位英特尔
- 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 模板时有些糟糕,如果标准库或编译器标志的版本与编译时使用的版本不完全匹配,则可能会导致链接器错误或崩溃。
相关文章:
- Xcode OSX上的C++构建失败,出现多个错误文件IO..不可用:在macOS 10.15中引入
- 什么是运行英特尔线程构建模块的 XCode 8 环境变量
- 某些C++标头在放入 Xcode 前缀/预编译标头时会中断构建
- MoltenVK(适用于 Vulkan)构建在 OS X v. 10.13.3 (17D102) 上失败 |Xcode
- 当我尝试构建和运行C 程序时,获取Xcode错误代码
- 在 Xcode 8.3 上构建一个C++正态分布式随机数生成器
- Xcode 9跌落以在C 中构建部分模板专业化
- 如何找到使用Xcode构建静态库时自我定义的名称空间
- 在Xcode上使用I/O套件的方法时,构建失败将失败
- 应用程序从 Xcode 构建时运行良好,不会直接从.app运行
- 使用 OpenCV 中的 Featured2D 和 XCode 构建错误
- 代码示例 "switch" (b.eckel) 不在 Xcode 上构建/运行,而是在 QT 上构建/运行
- 在 XCode 4.4.1 上构建 gtest 框架
- 我的 Mac SDK 的 Xcode 6.2 构建错误
- 找不到 Xcode 构建设置 - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS
- 用Xcode 3.2.6构建10.7 Lion应用程序-它们能工作吗
- xcode 构建错误:从指针到较小类型"int"的语义问题丢失了信息
- Poco c++ Crypto静态库在XCode构建时会产生错误
- XCode 构建失败"undefined Symbols for architecture x86_64"
- 如何用Xcode构建H3DAPI