Syntax error in core.hpp (missing semicolon)

asked 2015-02-15 00:03:17 -0500

lazywei gravatar image

Hi,

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?

Thanks.

edit retag flag offensive close merge delete

Comments

This is definately SWIG behaviour since OpenCV itself does not pose this problem when being compiled. As to including only the core file, that works but it will render your OpenCV support useless since you have not included a single function. If you want full OpenCV support than include the header file #include <opencv2/opencv.hpp>.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-02-15 03:18:16 -0500 )edit