2006/11/8, Simon Wittber <simonwittber@gmail.com>:
The function to load a dynamic library is 'package.loadlib'. The
'require' function can also do that if the library is built around the
Lua package model.
And I'd like to add that contrary to what Thomas wrote, loading a
dynamic/shared library the way Lua does it, that is by calling
LoadLibrary/dlopen and then getting a pointer to the functions in the
DLL, is faster than using a stub library and statically linking to
that stub library. The stub static library adds a level of indirection
compared to the use of functions pointer retrieved directly from the
manually loaded dll.