Note that there are some explanatory texts on larger screens.

plurals
  1. POLinker errors after upgrading Xcode to 4.5.2 and OpenCV to 2.4.3
    text
    copied!<p>My project was working just fine until this morning. I was using xcode 4.3, and an older version of OpenCV (I'm not sure about the exact version). OSX was already 10.7.x, but not 10.7.5<br /> <br /> Today, after upgrading OSX to 10.7.5, xcode to 4.5.2, and downloading OpenCV 2.4.3, I am getting the following linker errors when trying to build the project:<br /></p> <blockquote> <p>Undefined symbols for architecture armv7:<br /> "_OBJC_CLASS_$_ALAssetsLibrary", referenced from:<br /> objc-class-ref in opencv2(cap_ios_video_camera.o)<br /> "cv::FeatureDetector::create(std::string const&amp;)", referenced from:<br /> -[ImageAnalyzer detectBlobs:] in ImageAnalyzer.o<br /> "cv::FeatureDetector::detect(cv::Mat const&amp;, std::vector >&amp;, cv::Mat const&amp;) const", referenced from:<br /> -[ImageAnalyzer detectBlobs:] in ImageAnalyzer.o<br /> ld: symbol(s) not found for architecture armv7<br /> clang: error: linker command failed with exit code 1 (use -v to see invocation)</p> </blockquote> <p>In order to use the new opencv framework I removed the reference to the old framework, and referenced the project to the official prebuilt opencv2.framework downloaded from <a href="http://sourceforge.net/projects/opencvlibrary/files/opencv-ios/2.4.3/opencv2.framework.zip/download" rel="noreferrer">here</a>.<br /> I also removed the reference to <strong>libz.dylib</strong>, and added a reference to <strong>libc++.dylib</strong> instead.<br /> Last step was to update the prefix file to the new framework. The relevant part in the prefix file now looks like this:<br /></p> <pre><code>#ifdef __cplusplus #import &lt;opencv2/opencv.hpp&gt; #endif </code></pre> <p>It all narrowed down to these 4 linker errors I can't seem to get rid of. I tried using <strong>libstdc++.dylib</strong>, but I am getting even more errors. I also tried building OpenCV myself as explained <a href="http://docs.opencv.org/trunk/doc/tutorials/introduction/ios_install/ios_install.html#ios-installation" rel="noreferrer">here</a>, but I am still getting the same errors as the prebuilt framework.<br /> <br /> What did I miss? Is there anything else I need to change in my project?<br /> <br /> <br /> UPDATE:<br /> As seen <a href="http://code.opencv.org/issues/2500" rel="noreferrer">here</a>, setting the "C++ Standard Library" to "libc++ (LLVM C++ standard libray with C++ 11 support" yielded only one error:<br /></p> <blockquote> <p>clang: error: invalid deployment target for -stdlib=libc++ (requires iOS 5.0 or later)</p> </blockquote> <p>Changing the deployment target to iOS 5 finally got my project to run again.<br /> Does this mean OpenCV 2.4.3 doesn't work on iOS versions older than 5?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload