lua-users home
lua-l archive

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


2012/8/4 Doug <douglas.linder@gmail.com>:
> a) Exposing the lua symbols from the host application binary and
> linking your shared library specifically against that binary.
> Downside: doesn't seem to be possible under windows, links shared
> library against specific binary.

Just to clear some common misconception, this is possible on Windows.
An EXE can expose symbols (other than main/WinMain), and other modules
(DLLs or other EXEs) can link against it.

However that suffers the same limitation as when you link against a
DLL: the imported module name is hardcoded in the importing module
binary. In other words your module.dll will have hardcoded that it
needs "lua_pushstring@lua.exe". If the executable has a different name
it won't find the symbols. This defeats the purpose of an extension as
a reusable piece of (compiled) code, but it's still a valid way to
write plugins for existing apps.