I am new to Lua. I have ported Lua 5.2 to another platform. I am able to run Lua scripts.
But have a problem with loading modules.
I have a sample.lua script below. In this script I am trying to call a function available in another Lua script using the require function. The require function fails at lua_load() with LUA_ERRSYNTAX. Not sure if this is problem with Lua 5.2 version.
sample.lua
require"module"
welcome()
module.lua
function welcome()
print(" Hello in module")
end
The require function in sample.lua file locates the module.lua file but fails at lua_load().
Can anyone help me with this issue ?
lua_loadpushes an error message on the stack in case of failures. Are you able to retrieve that message? - ComicSansMS