I am currently a real beginner in Objective C, and I am developing an app using the framework OpenCV.
I am following a tutorial, but while builing the project, I got
You're missing the standard C++ library. You need to link with it to get all the implementations for the STL classes you're getting errors for.
Add the libc++.dylib to your project.
I had a similar problem, try removing "-lopencv_ts" from "Other Linker Flags"
This actually seems to hide the actual problem: the fact that your LLVM compiler may not choose a proper standard C++ library for compiling by default. You should go to
Project (or your Target) -> Build Settings -> Apple LLVM 6.0 - Language - C++ -> C++ Standard Library
and make sure that you pick libc++
as your choice, not just Compiler Default
, since modern OpenCV library is linked against libc++. This will solve your problem without having to add the extra libc++.dylib. Including libc++.dylib framework as a workaround will not always work out if your Compiler Default
actually does not choose libc++ library!
To check what "Compiler Default" is, you can do something like this. Mine somehow chooses c++98 as a default.
The user can also add the libc++.tbd
if libc++.dylib
is not available in the "Link Binary With Libraries"
Thanks Mitesh
Building on Cthutu's answer, to add libc++.dylib to your project: