lua-users home
lua-l archive

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


Hello, 
I am just fighting with require.

Here is a very short program (chunk1.lua):

require("compat-5.1")
print("chunk1 start")

strangely (at least I think it is strange) this results in the following
error message:

[bernd@impact36 lua_lib]$ lua chunk1.lua
lua: chunk1.lua:1: cannot find compat-5.1 in
path /madras/bernd/impact4-t/lua/lua_lib/?.lua;?.lua;/madras/bernd/impact4-t/lua/lua_lib/socket/?.lua;/madras/bernd/impact4-t/lua/lua_lib/logging/?.lua
stack traceback:
        [C]: in function `error'
        /madras/bernd/impact4-t/lua/lua_lib/compat-5.1.lua:70: in
function `require'
        chunk1.lua:1: in main chunk
        [C]: ?
[bernd@impact36 lua_lib]$ 

The error actually comes out of the file it claims not to find??
/madras/bernd/impact4-t/lua/lua_lib/compat-5.1.lua:70 which is I guess
in /madras/bernd/impact4-t/lua/lua_lib/?.lua 

 Oh yes, environment:

LUA_CPATH='/madras/bernd/impact4-t/lua/c_lib/?.so;?.so'
LUA_INIT=@/madras/bernd/impact4-t/lua/lua_lib/compat-5.1.lua
LUA_PATH='/madras/bernd/impact4-t/lua/lua_lib/?.lua;?.lua;/madras/bernd/impact4-t/lua/lua_lib/socket/?.lua;/madras/bernd/impact4-t/lua/lua_lib/logging/?.lua'
LUA_PATHLIB='/madras/bernd/impact4-t/lua/c_lib/?.so;?.so'


Yes I know, LUA_INIT has it already but I try to figure out why some of
our lua libraries which are required twice (because of dofile) actually
work the first time round but fail the second time round (even if
_LOADED says it is loaded already).  

Am I just missing something here??

Cheers,
	Bernd