lua-users home
lua-l archive

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


Hi
Luiz and Rob , Thank you for replying.

the problem was that I had set the env var
LUA_CPATH="C:/program files/my app"

After changing it to
LUA_CPATH="C:/program files/my app/myapp_lua.dll"

when I try
cmd.exe /K lua.exe -l myApp_Lua

it works


Strangely though, before changing the env var., when I tried

cmd.exe /K lua.exe  -l "C:/program files/my app/myapp_lua.dll" 

It showed me this error msg.
lua.exe: module 'myapp_Lua' not found:
        no field package.preload['myapp_Lua']
        no file '.\myapp_Lua.lua'
        no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.lua'
        no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua\init.lua'
        no file 'C:\Program Files\Lua\5.1\myapp_Lua.lua'
        no file 'C:\Program Files\Lua\5.1\myapp_Lua\init.lua'
        no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.luac'
        no file 'C:\Program Files\AMD\myapp\'
stack traceback:
        [C]: ?
        [C]: ?


But it is Working fine now after setting the LUA_CPATH environment variable to the actual dll instead of the containing directory.


thanks again for replying.

Anurag


On Tue, Sep 8, 2009 at 10:30 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> On the installation of my application, this dll will be copied in this
> location C:/program files/my app/myApp_Lua.dll
>
> I want to launch Lua console with "myApp_Lua.dll" loaded. How can I do so?
>
> Just to clarify the question I am providing an analogy with Perl where I
> have to run the following at Start->"Run"  to launch perl console with
> myApp_Perl.dll loaded
>
> cmd.exe /K perl5.10.0.exe  myApp_Perl.dll

In an ideal world, with correct paths sets, this would be

cmd.exe /K lua.exe -lmyApp_Lua

However, "C:/program files/my app/myApp_Lua.dll" is probably not in
the default LUA_CPATH and so you may need to adapt this to eg.

cmd.exe /K lua.exe -e'LUA_CPATH="C:/program files/my app/?.dll;" -lmyApp_Lua