lua-users home
lua-l archive

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


>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)
>

Thanks Jerome.  This is very helpful.  Thinking a bit ahead, I'd like
my module builds to be usable for distribution with LuaRocks.  From
you answer, I'm speculating that going the route described above would
make it incompatible.  Is the only solution then to link against a
lua.dll?

thanks again,
wes