In C++, we can include other files in our class declaration. The preprocessor will replace the #include directive with the appropriate content. In SWIG, we are able to reproduce this behaviour with the %include directive, however, this only seems to work at the end of the class declaration.
To reproduce the bug:
unzip bug.zip and run ./compilecommand
The error I get is:
example.h:10: Error: Syntax error in input(3).
When you replace example.h with example_working.h (in which the %include is at the end of the class declaration), then it all compiles, indicating that the bug only occurs when the %include directive is used at the beginning of the class declaration. We need to do this though, in order to be able to use the included enumeration types in the class declaration.
Any help towards fixing this is greatly appreciated,
Log in to post a comment.