gpt4 book ai didi

ios - 尝试在已经运行的项目中使用 OpenCV 框架时出现 Apple O-Linker 错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:47:36 25 4
gpt4 key购买 nike

我所做的是使用了 tutorial 中的一些代码基于openCV框架。从 EdgeDetectionSample.cpp 文件中,我导入代码。

Undefined symbols for architecture armv7: "std::__1::basic_string, std::__1::allocator >::basic_string(std::__1::basic_string, std::__1::allocator > const&)", referenced from: cv::Exception::Exception(int, std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, int) in opencv2(system.o) cv::Exception::Exception(cv::Exception const&) in opencv2(system.o) "std::__1::basic_string, std::__1::allocator >::~basic_string()", referenced from: cv::Mat::create(int, int const*, int) in opencv2(matrix.o) __ZN2cvL7setSizeERNS_3MatEiPKiPKmb in opencv2(matrix.o) cv::Mat::Mat(cv::Mat const&, cv::Range const&, cv::Range const&) in opencv2(matrix.o) cv::Mat::Mat(cv::Mat const&, cv::Range const*) in opencv2(matrix.o) cv::Mat::diag(int) const in opencv2(matrix.o) cv::Mat::Mat(_IplImage const*, bool) in opencv2(matrix.o) cv::Mat::reserve(unsigned long) in opencv2(matrix.o) ... "std::__1::basic_string, std::__1::allocator >::__init(char const*, unsigned long)", referenced from: cv::Mat::create(int, int const*, int) in opencv2(matrix.o) __ZN2cvL7setSizeERNS_3MatEiPKiPKmb in opencv2(matrix.o) cv::Mat::Mat(cv::Mat const&, cv::Range const&, cv::Range const&) in opencv2(matrix.o) cv::Mat::Mat(cv::Mat const&, cv::Range const*) in opencv2(matrix.o) cv::Mat::diag(int) const in opencv2(matrix.o) cv::Mat::Mat(_IplImage const*, bool) in opencv2(matrix.o) cv::Mat::reserve(unsigned long) in opencv2(matrix.o) ... "std::_1::_vector_base_common::__throw_length_error() const", referenced from: std::_1::vector, std::__1::allocator > >::_append(unsigned long) in opencv2(matrix.o) std::_1::vector, std::__1::allocator > >::_append(unsigned long) in opencv2(matrix.o) std::_1::vector, std::__1::allocator > >::_append(unsigned long) in opencv2(matrix.o) std::_1::vector, std::__1::allocator > >::_append(unsigned long) in opencv2(matrix.o) std::_1::vector, std::__1::allocator > >::_append(unsigned long) in opencv2(matrix.o) std::_1::vector, std::__1::allocator > >::_append(unsigned long) in opencv2(matrix.o) std::_1::vector, std::__1::allocator > >::_append(unsigned long) in opencv2(matrix.o) ... "std::__1::basic_string, std::__1::allocator >::operator=(std::__1::basic_string, std::__1::allocator > const&)", referenced from: cv::Exception::formatMessage() in opencv2(system.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

请帮我解决这个问题。我无法读取这些错误。

最佳答案

您的项目链接到libstd++(GNU C++ 标准库),但最新的 OpenCV 链接到libc++(支持 C++ 11 的 LLVM C++ 标准库),因此您有两种方法可以解决这个问题:

  1. 将您的项目链接到 libc++
  2. 使用 libstd++ 重建 OpenCV。

要将您的项目与 libc++ 链接,请转至 -> build设置 -> 找到“C++ 标准库”行并在此处选择 libc++。

关于ios - 尝试在已经运行的项目中使用 OpenCV 框架时出现 Apple O-Linker 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14701414/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com