在集成OpenCV框架时,出现armv7架构的未定义符号。

5

我在集成opencv2.framework时遇到了这个错误,有人可以帮忙解决吗?我的Xcode版本是4.5。

Undefined symbols for architecture armv7:
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      cv::Exception::Exception(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) in opencv2(system.o)
      cv::Exception::Exception(cv::Exception const&) in opencv2(system.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~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<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__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<true>::__throw_length_error() const", referenced from:
      std::__1::vector<cv::Vec<int, 128>, std::__1::allocator<cv::Vec<int, 128> > >::__append(unsigned long) in opencv2(matrix.o)
      std::__1::vector<cv::Vec<int, 64>, std::__1::allocator<cv::Vec<int, 64> > >::__append(unsigned long) in opencv2(matrix.o)
      std::__1::vector<cv::Vec<int, 32>, std::__1::allocator<cv::Vec<int, 32> > >::__append(unsigned long) in opencv2(matrix.o)
      std::__1::vector<cv::Vec<int, 16>, std::__1::allocator<cv::Vec<int, 16> > >::__append(unsigned long) in opencv2(matrix.o)
      std::__1::vector<cv::Vec<int, 12>, std::__1::allocator<cv::Vec<int, 12> > >::__append(unsigned long) in opencv2(matrix.o)
      std::__1::vector<cv::Vec<int, 9>, std::__1::allocator<cv::Vec<int, 9> > >::__append(unsigned long) in opencv2(matrix.o)
      std::__1::vector<cv::Vec<int, 8>, std::__1::allocator<cv::Vec<int, 8> > >::__append(unsigned long) in opencv2(matrix.o)
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > 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)
2个回答

14

你只需将 "libc++.dylib" 添加到“链接的框架和库”中即可。


嗨,如何实现呢? - gbossa

1
似乎这个框架没有编译支持 arm7。它需要使用当前的 Xcode 进行编译,以便能够针对必要的体系结构进行目标编译。
您是从源代码编译还是依赖于现有的二进制文件?
尝试使用此 Git 存储库进行源代码编译:https://github.com/jonmarimba/OpenCV-iOS

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接