lua-users home
lua-l archive

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


On 23 February 2012 22:36, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> It must be opened with '*' first. Lua keeps the result of the first
> 'dlopen' for a library and reuses it for other calls. But it may be
> a good idea to separate those auxiliary functions into a C library
> that has no Lua function (and no 'luaopen_' function), so it is never
> 'require'd.

This is what I was suspecting. First I wanted to bundle the "loader"
functions in the shared library itself, but finally I realized that
the only really working way is to have a pure shared library
(liblqt.so), and a "loader" Lua script - lqt.lua, which will handle
things like dependencies between modules. This way "require 'lqt'"
would still work as I imagined.