C++ Luabridge在没有“安全”的情况下不工作;luaL_openlibs(L)";
如果没有以下行,我不能使用luabridge:C++ Luabridge在没有“安全”的情况下不工作;luaL_openlibs(L)";,c++,lua,luabridge,C++,Lua,Luabridge,如果没有以下行,我不能使用luabridge: luaL_openlibs(lState); 我甚至不使用它的库函数 我得到这个错误: 断言失败:lua_istable(L,-1) 只需添加“luaL_openlibs(lState)”,就不会出现任何问题,但我不想使用lua的库,并且希望确保它们不包括在内 我的主要职能是: lua_State* lState = luaL_newstate(); //luaL_openlibs(lState); getGlobalNamesp
luaL_openlibs(lState);
我甚至不使用它的库函数
我得到这个错误:
断言失败:lua_istable(L,-1)
只需添加“luaL_openlibs(lState)”,就不会出现任何问题,但我不想使用lua的库,并且希望确保它们不包括在内
我的主要职能是:
lua_State* lState = luaL_newstate();
//luaL_openlibs(lState);
getGlobalNamespace(lState).addFunction("log", print).beginNamespace("math").addFunction("sin", &std::sinf);
luaL_dofile(lState, "res/script.lua");
LuaRef start = getGlobal(lState, "start");
try {
start();
} catch (const LuaException& e) {
std::cout << e.what();
}
lua_close(lState);
std::cin.get();
lua_State*lState=luaL_newstate();
//luaL_openlibs(lState);
getGlobalNamespace(lState).addFunction(“log”,print).beginNamespace(“math”).addFunction(“sin”,&std::sinf);
luaL_dofile(lState,“res/script.lua”);
LuaRef start=getGlobal(lState,“start”);
试一试{
start();
}捕获(常量LUAEException&e){
标准::cout