lua-users home
lua-l archive

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


2013/6/28 Sean Conner <sean@conman.org>:
>   I'm surprised that Lua doesn't look for just
>
>                 luaopen()
>
> as part of the search mechanism.

Putting aside name conflict issues in dynamic libraries (that may not
apply to your platforms), it's very easy to extend the module system
to implement the behaviour you describe. I wrote an example binary
loaded on the Lua wiki a while ago (for 5.1):

    http://lua-users.org/wiki/BinaryModulesLoader

Simply replace the package.loadlib second argument with a constant
string, and voilà, you can move your DLLs around (provided you name
the entry point with that constant string).