我正面临这个错误,在积分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)
您只需要添加"libc++ "。
似乎框架没有编译为支持arm7
。它需要使用当前的Xcode编译,以便它可以针对必要的架构。
您是从源代码编译还是依赖于现有的二进制文件?
尝试使用这个Git存储库获取源代码:https://github.com/jonmarimba/OpenCV-iOS