openCV 2.4.3 / Xcode 4.5.2 / mac osx 10.8.2
I am trying to open openCV with iOS. I am trying to use the predefined 2.4.3 structure with openCV.org. However, I get the following xcode project building errors, which suggest that the compiler does not know that it is dealing with C ++, for example
#include <list> !'list' file not found namespace cv !unknown type name 'namespace'
This is only similar to the following header files:
"Opencv2 / nonfree / features2d.hpp"
"Opencv2 / not free / nonfree.hpp"
"opencv2 / video / video.hpp"
If I don't include these three files in opencv.hpp (or somewhere else), I seem to be able to compile and use openCV ok. The trouble is that I need useless files, as I am experimenting with SURF, which has recently been ported to insecure.
This is a really twofold question (sorry ;-)
- How can I convince the compiler that these are C ++ headers?
- which contains the headers, do I need to use SURF?
Update
I cloned the openCV git repository and created a new structure from it. This approach did not work before, but today I realized that I did not use the current version of CMAKE. I used CMAKE 2.8.2 and this would not be able to create opencv for ios. The current version of CMAKE 2.8.10 builds it without any problems (it is required that the object lesson be in accordance with documents that say that CMAKE min. V2.8.8 is required).
Now, when I add this current build of the opencv framework in the Xcode project, I can enable the 2d functions, as well as without restrictions, and build smoothly. The only problem remains with one heading: video/background_segm.hpp , which still gives:
#include <list> !'list' file not found
If I comment on this line, I get an error on the following line:
namespace cv !unknown type name 'namespace'
It seems obvious that the compiler does not recognize this as a C ++ header, although it is suffixed with .hpp .
In opencv2/video/video.hpp if I remove
#include "opencv2/video/background_segm.hpp"
I can also build using video.hpp (although, in my opinion, this would be unsuitable in practice).
Unfortunately, I still can't get SURF to work. When I run the project, it crashes with this error:
OpenCV error: function / function not implemented (OpenCV was created without SURF support)
This works in legacy/features2d.cpp :
Ptr<Feature2D> surf = Algorithm::create<Feature2D>("Feature2D.SURF"); if( surf.empty() ) CV_Error(CV_StsNotImplemented, "OpenCV was built without SURF support");
Questions remain ...
- How can I convince the compiler that
background_segm.hpp is a legitimate C ++ header? - How to enable support for SURF?