Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6650569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:54:28+00:00 2026-05-26T00:54:28+00:00

I am using XCode4 and OpenCV 2.3. I have compiled a copy of OpenCV.

  • 0

I am using XCode4 and OpenCV 2.3.
I have compiled a copy of OpenCV. Here is the .a’s info:

libopencv_core.a: Mach-O universal binary with 3 architectures
libopencv_core.a (for architecture armv7):  current ar archive random library
libopencv_core.a (for architecture armv6):  current ar archive random library
libopencv_core.a (for architecture i386):   current ar archive random library

I drag it to the Frameworks floder, and set the right path of library search.
But when I compiled, it occurred such errors:

It seems that the STL which is used in OpenCV lib was not linked in the .a file.
How to fix it?

Thanks, bow.

Undefined symbols for architecture armv7:

"___cxa_begin_catch", referenced from:
      icvReadSeq(CvFileStorage*, CvFileNode*)       in libopencv_core.a(persistence.o)
  "typeinfo for std::exception", referenced from:
      typeinfo for cv::Exceptionin libopencv_core.a(alloc.o)
  "operator delete(void*)", referenced from:
      cv::Exception::~Exception()in libopencv_core.a(alloc.o)
  "_gzputs", referenced from:
      icvPuts(CvFileStorage*, char const*)in libopencv_core.a(persistence.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)", referenced from:
      cv::OutOfMemoryError(unsigned long)in libopencv_core.a(alloc.o)
      cv::Exception::~Exception()in libopencv_core.a(alloc.o)
      cv::Exception::~Exception()in libopencv_core.a(alloc.o)
      _cvCreateMatHeader in libopencv_core.a(array.o)
      _cvGetImageCOI in libopencv_core.a(array.o)
      _cvSetImageCOI in libopencv_core.a(array.o)
      _cvGetSize in libopencv_core.a(array.o)
      ...
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      cv::OutOfMemoryError(unsigned long)in libopencv_core.a(alloc.o)
      cv::Exception::Exception(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)in libopencv_core.a(array.o)
      _cvRegisterModule in libopencv_core.a(system.o)
  "___cxa_throw", referenced from:
      cv::error(cv::Exception const&)in libopencv_core.a(system.o)
  "___cxa_end_catch", referenced from:
      icvReadSeq(CvFileStorage*, CvFileNode*)       in libopencv_core.a(persistence.o)
  "_cvCvtColor", referenced from:
      -[cviosViewController CreateIplImageFromUIImage:] in cviosViewController.o
  "vtable for std::exception", referenced from:
      cv::Exception::Exception(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)in libopencv_core.a(array.o)
      cv::error(cv::Exception const&)in libopencv_core.a(system.o)
  "operator new[](unsigned long)", referenced from:
      cv::mixChannels(cv::Mat const*, unsigned long, cv::Mat*, unsigned long, int const*, unsigned long)in libopencv_core.a(convert.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      cv::OutOfMemoryError(unsigned long)in libopencv_core.a(alloc.o)
      cv::Exception::Exception(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)in libopencv_core.a(array.o)
      cv::error(cv::Exception const&)in libopencv_core.a(system.o)
      _cvRegisterModule in libopencv_core.a(system.o)
  "vtable for __cxxabiv1::__si_class_type_info", referenced from:
      typeinfo for cv::Exceptionin libopencv_core.a(alloc.o)
  "std::terminate()", referenced from:
      cv::error(cv::Exception const&)in libopencv_core.a(system.o)
  "___cxa_allocate_exception", referenced from:
      cv::error(cv::Exception const&)in libopencv_core.a(system.o)
  "___gxx_personality_sj0", referenced from:
      cv::OutOfMemoryError(unsigned long)in libopencv_core.a(alloc.o)
      _cvCreateMatHeader in libopencv_core.a(array.o)
      _cvGetImageCOI in libopencv_core.a(array.o)
      _cvSetImageCOI in libopencv_core.a(array.o)
      _cvGetSize in libopencv_core.a(array.o)
      _cvGetDims in libopencv_core.a(array.o)
      _cvGetElemType in libopencv_core.a(array.o)
      ...
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
      cv::OutOfMemoryError(unsigned long)in libopencv_core.a(alloc.o)
      _cvCreateMatHeader in libopencv_core.a(array.o)
      _cvGetImageCOI in libopencv_core.a(array.o)
      _cvSetImageCOI in libopencv_core.a(array.o)
      _cvGetSize in libopencv_core.a(array.o)
      _cvGetDims in libopencv_core.a(array.o)
      _cvGetElemType in libopencv_core.a(array.o)
      ...
  "operator delete[](void*)", referenced from:
      cv::mixChannels(cv::Mat const*, unsigned long, cv::Mat*, unsigned long, int const*, unsigned long)in libopencv_core.a(convert.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage", referenced from:
      cv::OutOfMemoryError(unsigned long)in libopencv_core.a(alloc.o)
      cv::Exception::~Exception()in libopencv_core.a(alloc.o)
      cv::Exception::~Exception()in libopencv_core.a(alloc.o)
      _cvCreateMatHeader in libopencv_core.a(array.o)
      _cvGetImageCOI in libopencv_core.a(array.o)
      _cvSetImageCOI in libopencv_core.a(array.o)
      _cvGetSize in libopencv_core.a(array.o)
      ...
  "std::exception::~exception()", referenced from:
      cv::OutOfMemoryError(unsigned long)in libopencv_core.a(alloc.o)
      cv::Exception::~Exception()in libopencv_core.a(alloc.o)
      cv::Exception::~Exception()in libopencv_core.a(alloc.o)
      cv::Exception::Exception(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)in libopencv_core.a(array.o)
      cv::error(cv::Exception const&)in libopencv_core.a(system.o)
      _cvRegisterModule in libopencv_core.a(system.o)

ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status

BTW: When I set the file name to .mm, the linker reports Internal Complier error. Bus error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:54:28+00:00Added an answer on May 26, 2026 at 12:54 am

    I get the answer.

    The MIN macro in OpenCV is conflict with MIN predefined in Xcode.

    Rename .m files to .mm, and change all MIN function to a new name such as CV_MIN in OpenCV’s header files.

    Check.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built the OpenCV libraries using the cmake build system as described here
Im using Xcode and c++ I have copied the HoughCircles code from the OpenCV
I'm implementing ShareKit in my app; I'm using XCode4 and have downloaded the ShareKit
I've just successfully built openCV as a static library for iOS armv7 architecture. However,
I'm using XCode4, and I have about 1000 audio files included in my application.
I have placed 3 images into UIImageViews using xcode4 interface builder: background, and two
i'm using xcode4. i have a xib window (perhaps copyed by another one, i
I am using XCode4.2 and developing and iPhone App I ususally save data using
using xcode 4.2 and iOS 5 and have nav bar on root controller and
Im creating a project in Xcode using OpenCV as a framework. It works great

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.