[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Cannot call Lua function from C code
- From: Sudhindra Murthy <murthy.sudhi@...>
- Date: Wed, 6 Jan 2010 21:03:42 +0530
I have a chunk of C code that is loading the Lua bytecode (generated using luac). The C code invokes a Lua function. But the Lua VM is not able to find the function.
Used the luac to generate the listing to check if the symbol (function) is present in the bytecode and it sure was.
Anyone has an idea? Call flow in C code as below
lua_open()
// Open Lua standard libraries - basic, table, string , etc
// Load App SDK - push C functions
luaL_loadbuffer -- to load bytecode
lua_pcall
All the above calls are successful.
lua_getglobal(luaState, func);
lua_isfunction(luaState,-1) ---> THIS IS FAILING
Please let me know for additional info.
Thanks,
Sudhi