opencv2.4.3 having linking problems on iOS
"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 ...
Could you specify code sample, iOS version, XCode version?
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);
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 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.
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.