我有这样的c ++ a.h文件
class myClass
{
private:
int a;
public:
myClass(){}
void foo(){}
};
看起来如何像SWIG接口文件? 这是真的?
%module a
%{
#include "a.h"
%}
答案 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"
%}