Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/149.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Lua脚本-再次运行_C++_C_Lua - Fatal编程技术网

C++ Lua脚本-再次运行

C++ Lua脚本-再次运行,c++,c,lua,C++,C,Lua,我的C/C++应用程序中嵌入了Lua。如果我使用 lua_pcall( luaState, 0, LUA_MULTRET, 0 ); 第一次,一切正常(返回0)。但我需要在一段时间后再次运行脚本。再次调用同一个函数时,脚本不会执行,retun值为2。如果不从文件重新加载所有内容,如何再次运行它 将其在堆栈上推两次或将其作为全局变量存储

我的C/C++应用程序中嵌入了Lua。如果我使用

lua_pcall( luaState, 0, LUA_MULTRET, 0 );

第一次,一切正常(返回0)。但我需要在一段时间后再次运行脚本。再次调用同一个函数时,脚本不会执行,retun值为2。如果不从文件重新加载所有内容,如何再次运行它

将其在堆栈上推两次或将其作为全局变量存储