In SWIG compilation: Other header files cannot be resolved in the header file in the interface.

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

+4
source share
2 answers

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

+4
source

SWIG #include . , , SWIG . -includeall, , , , . include:

#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"
+1

All Articles