lua-users home
lua-l archive

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


Yang Fan wrote:
Thanks for replying.
The function "main" gets an argument, so we should push something into the virtual stack after lua_getglobal.
Maybe somewhere else makes things incorrect.


Sorry. I missed that. Then your pcall is wrong.
if (lua_pcall(L, 0, 0, 0) != 0)

shouldn't be if (lua_pcall(L, 1, 0, 0) != 0)

http://www.lua.org/manual/5.1/manual.html#lua_pcall