C ++头文件的SWIG接口文件

时间:2018-10-18 13:36:19

标签: swig

我有这样的c ++ a.h文件

class myClass
{
private: 
  int a;
public: 
  myClass(){} 
  void foo(){}
};

看起来如何像SWIG接口文件? 这是真的?

%module a
%{
#include "a.h"
%}

1 个答案:

答案 0 :(得分:2)

否,

%module a
%{                // This adds the include to the generated wrapper.
#include "a.h"
%}
%include "a.h"    // This *processes* the include and makes wrappers.

或:

%module a
%inline %{       // This includes the code in braces in the wrapper *and* processes it.
#include "a.h"
%}