lua-users home
lua-l archive

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


> [...]
> 
> Simply adding `-static` in the linking flags, together with `-llua` and
> `-lm` doesn't work, since `luaL_openlibs()` calls `dlopen`...
> 
> [...]
> 
> The question is, instead, how do I avoid the call of `dlopen` in the first
> place?

Just a small correction, for the records: Lua never *calls* 'dlopen' by
itself. In particular, 'luaL_openlibs' does not call 'dlopen'. Lua
only calls 'dlopen' if the script calls 'require' (and 'require' finds
an appropriate file in the C path) or if the script calls
'package.loadlib'. (Of course, that does not elliminate the fact that
Lua has to be linked to the dlopen library with -ldl, therefore
causing the problems you are relating.)

-- Roberto