I'm trying to use SWIG to wrap OpenCV's C++ API. However, when I compile, I got this error:
/usr/local/Cellar/opencv/2.4.10.1/include/opencv2/core/core.hpp:123:
Error: Syntax error - possibly a missing semicolon.
and here is my SWIG file
%module example
%{
#include "opencv2/core/core.hpp"
%}
%include "opencv2/core/core.hpp"
I'm not sure if this is an error from SWIG or from OpenCV. Is it OK to only include core.hpp
like this?
Thanks.
OK, I found the problem might be caused by the nested header including.
In opencv2/core/core.hpp
, there is
#include "opencv2/core/types_c.h"
#include "opencv2/core/version.hpp"
and hence if I add these two headers to my swig file:
%include "opencv2/core/types_c.h"
%include "opencv2/core/version.hpp"
%include "opencv2/core/core.hpp"
It will not raise the missing semicolon error.