1

I added lua into my c++ project and now I would like to know if its somehow possible to set the "L" global or something like that?

lua_State* L = lua_open();

currently I have in the main function:

lua_State* L = lua_open();
luaopen_base(L);

but on an other file I need to call this function:

int result = lua_tinker::call<int>(L, "Lv", 1);

but the "L" Doesnt work and I dont want to open & close Lua every time I have to call one function.

or should I use

lua_State* L = lua_open();
luaopen_base(L);

every time I need to call a lua function?

hjpotter92
  • 78,589
  • 36
  • 144
  • 183
metabeta
  • 27
  • 2

0 Answers0