Re: SWIG and LUA: how to define multiple modules in a *.i file ?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: SWIG and LUA: how to define multiple modules in a *.i file ?
- From: "mark gossage" <mark@...>
- Date: 2007年10月17日 18:51:48 -0600
> hi,
> I am using SWIG with LUA5.1, can i define multiple modules in a *.i file.
>
> I tried it, but SWIG does not registe other modules but the first one.
>
Hello YouZhi,
Sorry, SWIG cannot do that.
A module in SWIG represents a single collection of functions which are wrappered together. Under Lua, they are all stored within a single table entry.
If you want two modules, then use two files.
---ModA.i ---
%module ModA;
%include "somefile.h"
-------
---ModB.i ---
%module ModB;
%include "someotherfile.h"
-------
Then SWIG and compile the two files separately.
Then you load each on their own.
require "ModA"
require "ModB"
Hope this helps.
Mark