lua-users home
lua-l archive

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


On Sun, Jul 15, 2012 at 2:55 PM, Doug <douglas.linder@gmail.com> wrote:
> Can anyone point me at a tutorial or possibly just give me some advice on
> how to call the lua c api from a plugin?
>
> I naively linked a second copy of the lua runtime in (ie. as part of the
> .so) thinking that might work, but I've stumbled into the same issue
> mentioned all the way back here:
> http://lua-users.org/lists/lua-l/2008-01/msg00671.html
>
> Crashes and burns on newkey() (this is with 5.1.3, which I'm stuck with)

You've correctly identified the issue; a lua_State* can only be used
with the copy of the Lua runtime which created it. If you're writing a
plugin for an application, then you'll need to talk to the authors of
the application in question to see if they export the symbols for
their copy of the Lua runtime.