[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: static linking with lua
- From: Sam Roberts <vieuxtech@...>
- Date: Sat, 5 Mar 2011 11:54:05 -0800
> 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.