【发布时间】:2016-04-11 01:43:05
【问题描述】:
我在尝试从 C++ 访问的 Lua 中有一个全局表。 这基本上是我想要做的:
卢阿:
myTable = {}
myTable[1] = 1
C++:
lua_State* L = luaL_newstate();
luaL_openlibs(L);
lua_pcall(L, 0, 0, 0);
lua_State* L2 = luaL_newstate();
luaL_dofile(L, "luaScript.lua");
LuaRef myTable= getGlobal(L, "myTable");
cout << myTable[0];
我的cout 出现错误,提示:
错误 C2593 'operator
但我认为这些错误不是问题。
如何访问该值?
【问题讨论】: