[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: calling lua library from embedded interpreter
- From: steve donovan <steve.j.donovan@...>
- Date: Sat, 5 Jan 2013 12:47:24 +0200
On Sat, Jan 5, 2013 at 12:37 PM, Paul Anton Letnes
<paul.anton.letnes@gmail.com> wrote:
> noob question alert. I've been googling around, trying to figure out how I can use lua libraries (I was looking at LuaSocket) from inside of an embedded application. So far, I've only found instructions for how to do install libraries into standalone interpreters
It works in a very similar way. First, you will modify your
package.path so that it looks in a directory local to your application
- would probably need to do this anyway.
package.path = myluadir..'/?.lua;'..package.path
And you can do the same trick with C extensions, by modifying
package.cpath so that they are found local to the application. With
Windows the only gotcha is building the LuaSocket DLLs using the same
toolchain as your Lua DLL and application.
This is fine for Windows, because it's common (even recommended) for
an application to have its own folder with its own DLLs.
steve d.