[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: lua modules and linking to the lua dll on windows
- From: "Jerome Vuarand" <jerome.vuarand@...>
- Date: Tue, 29 Jan 2008 16:26:27 -0500
Wesley Smith wrote:
> The way I'm building modules right now with GCC uses -undefined
> dynamic_lookup to avoid having to link with a lua library since it's
> embedded in my app and I want modules to get their symbols from
> there. Is there an equivalent functionality on Windows? Can an app
> export symbols which a dll (i.e. module) can then find when it's
> loaded by the app?
You can export symbols from your exe with either __declspec(dllexport)
directives or a .def file. The linker should generate an import library
that you can use to link your module. The drawback of that method is
that the modules will have the exe filename hardcoded in their import
section, so you cannot rename the exe afterwards.
(This is valid for VC++, for MinGW GCC symbol export is the same, but
for linking your modules just pass the exe as input file instead of the
.lib)