lua-users home
lua-l archive

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


> Lua C modules need to resolve symbols to the Lua C API (dynamically at
> runtime).  If you statically compile/link your whole program, then those
> symbols will not be available to the dynamic linker.
>
> So basically you can't dynamically load Lua C modules into a statically
> compiled program.

Perhaps I misunderstand what you all mean by static, but the standard
lua binary is statically linked to the lua runtime, and can call
dlopen(), check its build options in the Makefile.

IIRC, there is an option to tell gcc to statically link, but export
the symbols, those exported symbols are then available to modules when
they are loaded.

Cheers,
Sam