'Why does SWIG's -includeall option not work for me?
I'm trying to wrap various types and functions defined in C with SWIG for the use in Python. When learning the basics of SWIG, I included every header with %include in the .i-interface file with success. However, the complete interface I need to wrap is located in several headers that get included with #include in one main interface header, like so:
// complete_interface.h
#include "interface_part1.h"
#include "interface_part2.h"
// ...
#include "interface_partn.h"
Currently, my interface file looks like this:
%module some_module
%{
#define SWIG_FILE_WITH_INIT
#include "complete_interface.h"
%}
%include "complete_interface.h"
To recurse into the headers that are included by complete_interface.h, I'm invoking SWIG with the -includeall option. Unfortunately, the headers ìnterface_part1.h, interface_part2.h, ... are not processed by SWIG - the resulting some_module_wrap.c file does not contain any of their definitions.
Since the header files that will be included by complete_interface.h are subject to change, I don't want to %include every part of the interface seperately.
This is the command that I'm using in a custom build step within Visual Studio:
swig -c++ -python -py3 -includeall -I$(ProjectDir)..\include -o $(ProjectDir)some_module_wrap.cxx $(ProjectDir)some_module.i
Am I using the -includeall option wrong? Can somebody explain this behavior?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
