我正在尝试迭代lua表,但是我一直收到以下错误:我知道索引从-8开始,我知道那里有一个表,因为它得到了其中的第一个(也是唯一的)值。然而,即使我知道表中只有一个字符串,它还是试图再次循环。if (lua_istable(L, index)) lua_pushnil(L);
// This is needed for it to even get the first
我使用luajit库包装了一个C库,其中包含一个函数,用于在ppm文件上绘制文本:当我试图使用字符串从lua调用它时,我会得到这个错误bad argument #4 to 'drawText' (cannot convert 'string' to 'char看起来lua字符串库没有任何东西可以将整个字符
我有一个Lua脚本,它调用一个C函数。目前,此函数不返回任何内容。我想要更改这个函数以返回一个字符串,所以在这个函数的末尾,我将把这个字符串推到Stack中。在调用Lua脚本中,我需要返回被推送的字符串值。the function to be called from LUA script to execute commands*/
lua_register(L,&q