In the interface file. I have included a header file. There are many header files in this header file, but from the top tree bases. But Swig fails to recognize those
Eample:
main.h #include<dir/second.h> #define PAGE 1
Swig cannot resolve this directory in the header file
Use
-I<dir>
at the SWIG prompt to tell SWIG about included paths that it does not know about.
See SWIG 2.0 Command Line Documentation
SWIG #include . , , SWIG . -includeall, , , , . include:
-includeall
#include <stdio.h> #include <stdlib.h> #include "b.h" #include "c.h"
.i , , a.h, b.h c.h , , :
%module example %{ #include "a.h" %} %include "a.h" %include "b.h" %include "c.h"