In SWIG compilation : In header file in interface is unable to resolve other header files.

北城以北 提交于 2019-12-05 13:10:55

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:

a.h

#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"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!