lua-users home
lua-l archive

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

I tried 
when I try the following, I get error message

lua -e "package.path='\\mypath\?.lua;'..package.path" -lmyapp_Lua ...

error message is as follows

lua: C:\a\ScriptingLanguageSupport\Lua1.lua:5: attempt to index global 'myapp_Lua'
(a nil value)
stack traceback:
        C:\a\ScriptingLanguageSupport\Lua1.lua:5: in main chunk
        [C]: ?
        [C]: ?

Some background information,
I have alerady set the following enviroment variables,
Path, Lua_dev, Lua_path, Lua_CPath
Also the same script works when I run it from Lua console by using a dofile command. In that case I launch Lua console using  cmd /K lua -lmyapp_Lua..

On Tue, Sep 15, 2009 at 7:01 PM, steve donovan <> wrote:
On Tue, Sep 15, 2009 at 3:24 PM, Anurag Sharma
<> wrote:
> 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'

This error message is instructive; Lua is just telling you that your
myapp_Lua module is not found on the Lua module path. Is myapp_Lua.lua
in one of the these standard places?  If not, either move it there, or
read up about the LUA_PATH environment variable.

Another approach is something like:

lua -e "package.path='\\mypath\?.lua;'..package.path" -lmyapp_Lua ...

This works because Lua uses the value of package.path to match modules.

steve d.