> seems that you trying to emulate C "#include", right? so there's no
> reason to use "module" here (require will work just fine without it).
Yes, that's exactly what I am trying to do ^_^
Jerome Vuarand wrote:
> the Lua API function that you used to execute the script must be returning > you an error, which explicit what happened. If you used lua_pcall, luaL_ > dostring or luaL_dofile, and the return value is non-zero, there should be > a string on the Lua stack describing the error. You can display it with: > > printf("%s\n", lua_tostring(L, -1));
I use "lua_pcall(pLuaState, 0, 0, 0)" to load my file.
Errors returned are :
- ./Data/Scripts/Main.lua:1: attempt to call global 'require' (a nil value)
First line of my Main.lua is of course : require "a"
Should I deduce that the file "a.lua" is not found ? I tried to put it in several paths, though unsuccessfully.
Laboratoire d'Ingénierie des Systèmes Automatisés,
62, Avenue Notre Dame du Lac - 49000 Angers
Tél. (33).220.127.116.11.86 - Fax : (33).18.104.22.168.21