Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined symbols for architecture armv7 on integrating OpenCV framework

I am facing this error, when integrating opencv2.framework, can any one help this out. My Xcode version is 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)
like image 774
user1485749 Avatar asked Mar 04 '13 07:03

user1485749


2 Answers

You only need to add "libc++.dylib" into your "Linked Frameworks and Libraries"

like image 116
Mr. Sun Lin Avatar answered Nov 09 '22 06:11

Mr. Sun Lin


It appears the framework is not compiled to support arm7. It needs to be compiled using the current Xcode so that it can target the necessary architectures.

Are you compiling from source or relying on an existing binary?

Try using this Git repository for source: https://github.com/jonmarimba/OpenCV-iOS

like image 24
Richard Brown Avatar answered Nov 09 '22 06:11

Richard Brown