lua-users home
lua-l archive

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


Ketmar Dark wrote:

> 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 :
- LUA_ERRRUN
- ./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.


Thanks !


François-Xavier INGLESE

Laboratoire d'Ingénierie des Systèmes Automatisés,
62, Avenue Notre Dame du Lac - 49000 Angers
Tél. (33).2.41.22.65.86 - Fax : (33).2.41.22.65.21
http://www.istia.univ-angers.fr/LISA