求助:用过C++与LuaPlus的请进
lua脚本:
function logDate()
return os.date("%m/%d/%Y-%H:%M:%S");
end
C++中调用
LuaStateOwner state;
LuaFunction <const char*> log=state->GetGlobal("logDate");
const char* msg=log();
报错:
xxx.lua:2: attempt to index global 'os' (a nil value)
也就是当lua脚本中包含os io 等Lua标准库的时候不能加载。
在脚本中用require "os"; 也不好使
新手刚开始接触luaplus 请各位指教
谢谢!