lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

"Martin C. Martin" <> writes:
> What libraries would someone recommend for binding Lua to parts of a
> large, existing C++ code base?  It needs to work in both Windows and
> Linux.  I'm looking at LuaPlus (I know, it's a lot more than just a C++
> binding), but perhaps that's not the place to start?

I use swig, which is very flexible, works with multiple languages, has
fairly easy/mechanical interface definitions[*], and generates Lua
interfaces which usually capture most of the nuances of the C++
interface (e.g., overloading, inheritance).

[*] It looks at C++ declarations directly, so theoretically you can just
feed it your existing .h files and have it generate the appropriate
interfaces; in practice, you often want to give it slightly massaged
versions, but it's pretty easy to do this.

The downside is that the code it generates can be a bit bloated.  So
it's maybe not what you want for a small embedded app with simple


Cat, n. A soft, indestructible automaton provided by nature to be kicked when
things go wrong in the domestic circle.