2

I'm trying to using both OpenCV and Tesseract in my iPhone app.

I have no problem working with either one of them - all is compiled and linked perfectly.

But when I'm trying to work with both of them it gives me link errors:

Undefined symbols for architecture i386:
"cv::_OutputArray::_OutputArray(cv::Mat&)", referenced from:
  -[BTLOpenCVCameraViewController processImage:] in BTLOpenCVCameraViewController.o
"cv::_OutputArray::~_OutputArray()", referenced from:
  -[BTLOpenCVCameraViewController processImage:] in BTLOpenCVCameraViewController.o
"cv::Mat::deallocate()", referenced from:
  cv::Mat::release() in BTLOpenCVCameraViewController.o
"cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)", referenced from:
  -[BTLOpenCVCameraViewController processImage:] in BTLOpenCVCameraViewController.o
"cv::fastFree(void*)", referenced from:
  cv::Mat::~Mat() in BTLOpenCVCameraViewController.o
"cv::Mat::copyTo(cv::_OutputArray const&) const", referenced from:
  -[BTLOpenCVCameraViewController processImage:] in BTLOpenCVCameraViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm running iOS6.1, C++ Standard Library is set to: "Compiler Default" Architecture is set to: armv7.

ANy ideas??

Shvalb
  • 1,835
  • 2
  • 30
  • 60
  • You obviously are trying to build a simulator version (i386) - are both of your libraries also built for the simulator? – Till Feb 10 '13 at 21:10
  • OpenCV library must be run on iPhone device since it opens the camera-live-view, but Tesseract can run on simulator. But, but If I comment the code of the OpenCV then Tesseract compiles and links perfectly, and vice versa. the problem is when trying to link them both together. – Shvalb Feb 11 '13 at 03:57
  • Yes, each one of them runs without any problem. – Shvalb Feb 11 '13 at 04:10
  • Ok, I compiled it on device, and these are the errors I receive: Undefined symbols for architecture armv7: "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) – Shvalb Feb 11 '13 at 19:50
  • 2
    OpenCV needs to be compiled with: "C++ standard library" as "LLVM C++ standard libray with C++ 11 support. Tesseract needs to be compiled with: "C++ standard library" as "Compiler default" one library contradicts the other, how can I overcome this?? – Shvalb Feb 11 '13 at 20:07
  • Check [this answer](http://stackoverflow.com/questions/12665457/zxing-in-xcode-4-5-and-ios-6/12666175#12666175) on the subject of setting up the standard library settings of a project / subproject / library. – Till Feb 12 '13 at 00:46
  • 1
    Make any progress on this? I am interested in a solution too. – theprojectabot Feb 18 '13 at 22:00

0 Answers0