I included OpenCV in my Xcode project as given here.
Then I declare an openCV Matrix object cv::Mat in my header file.
@interface TestViewController : UIViewController
{
cv::Mat myMat;
}
When I try to compile this fails with error, “Type name requires a specifier or qualifier“
The same problem does not happen when I locally declare a cv::Mat object in my .mm files. Also, a sample project I have has the same cv::Mat objects declared in its header files, and that project compiles.
Why does this happen?
Issue was solved when i changed the source file-name extension to
.mm.