In interface File. I have included a header file.In that Header file there are many header files included but from top tree bases But in Swig is not able to recognize those
Eample:
main.h
#include<dir/second.h>
#define PAGE 1
Swig is unable to resolve that dir in the header file
Use
-I<dir>
on the SWIG command line to tell SWIG about include paths it doesn't know about.
See SWIG 2.0 command line documentation
SWIG normally does not process #include files recursively. The reason is you would not want SWIG to process every system header file. You can override this with -includeall
, but that is probably not what you want. Instead, consider the following include file:
#include <stdio.h>
#include <stdlib.h>
#include "b.h"
#include "c.h"
For this, use the following .i file if you want the declarations in a.h, b.h and c.h to be exposed, but do not want the system header files processed:
%module example
%{
#include "a.h"
%}
%include "a.h"
%include "b.h"
%include "c.h"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With