[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: LoadLibrary and 5.2
- From: "Antonio Scuri" <scuri@...>
- Date: Tue, 12 Jan 2010 14:57:48 -0200
So you are saying that one possible solution is to call SetDllDirectory on the Lua interpreter?
Checking its documentation it looks promising. The only drawback is that it needs Service Pack 1 in Windows XP.
> -----Original Message-----
> From: email@example.com [mailto:lua-
> firstname.lastname@example.org] On Behalf Of Cosmin Apreutesei
> Sent: terça-feira, 12 de janeiro de 2010 12:38
> To: Lua list
> Subject: Re: LoadLibrary and 5.2
> > I understand what you are saying but the main motivation for the
> > was NOT to find modules, it was to find DLLs that the modules depend
> on and
> > that are not Lua modules.
> > For example, iuplua depends on iup. When iuplua is required the iup
> > must also be found. And this is NOT handled by the package.cpath. Lua
> > Windows has lots of these DLLs that are NOT modules. That's the only
> > the Lua for Windows installation must change the PATH so these DLLs
> can be
> > found in the "clibs" subfolder.
> > Is there any other solution to this problem despite changing
> As usual M$ solve it very late in the game... Here's a snippet from my
> win32 test suite of fbclient:
> --bind SetDllDirectory from kernel32.dll (available in WinXP SP1+ and
> --it's the official way in Windows to load a bunch of related dlls
> from a directory of your chosing.
> local alien = require'alien'
> local kernel32 = alien.load('kernel32')
> local ok,err = xpcall(function()
> if not ok then
> error ([[
> Sorry but you need a kernel32.dll with SetDllDirectoryA() (WinXP SP1+
> or Vista)
> to run the automated test suite on Windows.
> The error was: ]]..err)
> function set_dll_directory(dir)
> assert(kernel32.SetDllDirectoryA(dir) ~= 0, 'SetDllDirectoryA()