I get the error message:
-- [string "example"]:1:attempt to call global 'require' (a nil value)
when I execute a program that passes 'require("power")' to lua via
luaL_loadbuffer(L, myscript, strlen(myscript), "example")
followed by
lua_pcall(L, 0, 0, 0).
If I set myscript to 'print("Hello, world")' lua successfully prints the message.
If I use the lua interpreter it quite happily loads the power dll and I can call the functions within it successfully too.
I downloaded the latest version of Lua, 5.2.2, and created the dll and the interpreter from it. Dependency Walker shows no problems with the dll.
I created the the exes and dlls using MinGW within Code::Blocks 12.11 on Windows 7.
Does anybody have any ideas as to what I'm not doing correctly?
-- [string "example"]:1:attempt to call global 'require' (a nil value)
when I execute a program that passes 'require("power")' to lua via
luaL_loadbuffer(L, myscript, strlen(myscript), "example")
followed by
lua_pcall(L, 0, 0, 0).
If I set myscript to 'print("Hello, world")' lua successfully prints the message.
If I use the lua interpreter it quite happily loads the power dll and I can call the functions within it successfully too.
I downloaded the latest version of Lua, 5.2.2, and created the dll and the interpreter from it. Dependency Walker shows no problems with the dll.
I created the the exes and dlls using MinGW within Code::Blocks 12.11 on Windows 7.
Does anybody have any ideas as to what I'm not doing correctly?