Ask Your Question
1

opencv2.4.3 having linking problems on iOS

asked 2012-11-10 01:45:17 -0600

sap gravatar image

"cv::_InputArray::_InputArray(std::vector<cv::mat, std::allocator<cv::mat=""> > const&)", referenced from:

  -[FirstScreen filter1action] in FirstScreen.o

"cv::_OutputArray::_OutputArray(std::vector<cv::mat, std::allocator<cv::mat=""> >&)", referenced from:

  -[FirstScreen filter1action] in FirstScreen.o

"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:

  std::__1::enable_if<__is_forward_iterator<unsigned long*>::value, void>::type std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >::assign<unsigned long*>(unsigned long*, unsigned long*) in opencv2(matrix.o)


  std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >::vector(unsigned long) in opencv2(matrix.o)


  std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >::__append(unsigned long) in opencv2(matrix.o)


  std::__1::vector<cv::Vec<float, 2>, std::__1::allocator<cv::Vec<float, 2> > >::vector(unsigned long) in opencv2(matrix.o)


  std::__1::vector<int, std::__1::allocator<int> >::vector(unsigned long) in opencv2(matrix.o)


  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::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)


  cv::setSize(cv::Mat&, int, int const*, unsigned long const*, bool) 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::Rect_<int> 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)


  ...

"std::__1::basic_string<char, std::__1::char_traits<char="">, std::__1::allocator<char> >::__init(char const*, unsigned long, unsigned long)", referenced from:

  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in opencv2(system.o)

"std::__1::basic_string<char, std::__1::char_traits<char="">, std::__1::allocator<char> >::append(char const*)", referenced from:

  cv::tempfile(char const*) in opencv2(system.o)

"std::__1::basic_string<char, std::__1::char_traits<char="">, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:

  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in opencv2(system.o)

"std::__1::basic_string<char, std::__1::char_traits<char="">, std::__1::allocator<char> >::assign(char const*)", referenced from:

  cv::tempfile(char const*) in opencv2(system.o)

"std::__1::basic_string<char, std::__1::char_traits<char="">, std::__1::allocator<char> >::resize(unsigned long, char)", referenced from:

  icvClose(CvFileStorage*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1 ...
(more)
edit retag flag offensive close merge delete

Comments

Could you specify code sample, iOS version, XCode version?

AlexanderShishkov gravatar imageAlexanderShishkov ( 2012-11-10 02:56:26 -0600 )edit

Xcode 4.5 , iOS 6. I am just trying to implement a sepia filter

-(cv::Mat)sepiaConversion:(cv::Mat)inputMat { cv::Mat sepiaMat = cv::Mat( inputMat.size(), inputMat.type() ); CvMat *sepia = cvCreateMat(4, 4, CV_32F);

CV_MAT_ELEM(*sepia, float, 0, 0) = 0.189;
CV_MAT_ELEM(*sepia, float, 0, 1) = 0.769;
CV_MAT_ELEM(*sepia, float, 0, 2) = 0.393;
CV_MAT_ELEM(*sepia, float, 0, 3) = 0;

CV_MAT_ELEM(*sepia, float, 1, 0) = 0.168;
CV_MAT_ELEM(*sepia, float, 1, 1) = 0.686;
CV_MAT_ELEM(*sepia, float, 1, 2) = 0.349;
CV_MAT_ELEM(*sepia, float, 0, 3) = 0;

CV_MAT_ELEM(*sepia, float, 2, 0) = 0.131;
CV_MAT_ELEM(*sepia, float, 2, 1) = 0.534;
CV_MAT_ELEM(*sepia, float, 2, 2) = 0.272;
CV_MAT_ELEM(*sepia, float, 0, 3) = 0;

CV_MAT
sap gravatar imagesap ( 2012-11-10 22:13:03 -0600 )edit
1

I am having a similar problem with XCode 4.5.1 and OpenCV 2.4.3. More precisely:

  • If I compile with libc++ I get the infamous 'ext/atomicity.h' exception that others have talked about

  • If I compile with libstdc++, I get a long list of Undefined symbols as in the posting.

As a side note: I seem to have these problems when I try to link openCV to an older project. If I start a new project and link it to the openCV framework, it compiles fine. Yet the project settings are the same for both projects.

ilmandu gravatar imageilmandu ( 2012-11-11 02:00:02 -0600 )edit

@ilmandu Did you figure out what the difference was between projects? I am building a module with opencv successfully but it causes these errors when I link with another iOS project.

jbeuckm gravatar imagejbeuckm ( 2012-12-31 08:51:27 -0600 )edit

I also had the same problem mentioned above. Selecting libc++ gave me the ext/atomicity.h exception. Selecting libstdc++ gave me the list of Undefined symbols. I tried recompiling OpenCV with the GCC options in the Toolchain files but that didn't help (so I reverted back to the standard state).

After checking all of the Build Settings attributes, I noticed that the Framework Search Path had several entries for other versions of OpenCV that I've upgraded from in the past. After removing all of the outdated ones, I was able to get my project to compile without the ext/atomicity.h exception.

bservo gravatar imagebservo ( 2013-03-03 10:53:52 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-02-19 02:55:27 -0600

Andrei Blaj gravatar image

I had the same problem. I solved it by setting in the XCode project Build Settings, for C++ Standard Library: libc++ (LLVM C++ standard library with C++ 11 support).

It is obvious from the errors that the problem is from the STD (standard C++ Library), so you should play around with the C++ Standard Library setting.

Hope it helps.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-11-10 01:45:17 -0600

Seen: 2,695 times

Last updated: Feb 19 '13