[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Writing extensions which interact (is not fun)
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Mon, 6 Aug 2012 10:49:53 +0100
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.