I’m reading some source codes of a project, which is a combination of c++ and lua, they are interwined through luabind.
There is a la.lua file, in which there is a function exec(arg). The lua file also uses functions/variables from other lua file, so it has statements as below in the beginning
module(…, package.seeall);
print(“Loading “…debug.getinfo(1).source…”…”)
require “client_config”
now I want to run la.exec() from interactive terminal(on linux), but I get errors like
attempt to index global ‘lg’ (a nil value)
if I want to import la.lua, I get
require “la”
Loading @./la.lua…
./la.lua:68: attempt to index global ‘ld’ (a nil value)
stack traceback:
./lg.lua:68: in main chunk
C: in function ‘require’
stdin:1: in main chunk
what can I do?