I have followed the instructions on how to install OpenCV on an iOS project. However when using Xcode 7 I had to add manually a prefix header. Doing this unfortunately did not h
OpenCV is a C++
framework, which means that any code that makes use of OpenCV has to be compiled with C++
interpretation, rather than C
interpretation.
The errors you see, e.g. with the using namespace cv;
indicate that the code is compiled using the objective-C compiler, rather than the objective-C++ compiler.
As I mentioned in my comment the easiest way to get this to happen is to ensure that any file that #include
s an opencv header must be named e.g. ViewController.mm
, i.e. it must be an Objective-C++ file.
Alternatively, you can select and override the Type
of the file, by explicitly selecting the Objective-C++ Source
option for the file type in the utilities pane.