Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.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/9/ios/94.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
Iphone (Lua+;iOS)使用Lua#U pushstring时出错_Iphone_Ios_Lua_Fpc - Fatal编程技术网

Iphone (Lua+;iOS)使用Lua#U pushstring时出错

Iphone (Lua+;iOS)使用Lua#U pushstring时出错,iphone,ios,lua,fpc,Iphone,Ios,Lua,Fpc,代码: 问题:当我使用变体“B”和“C”并在我的iPad上启动project时,应用程序在启动时闪烁,然后关闭,出现下一个错误: (iPad)控制台日志中的错误: A) lua_pushnumber(LuaInstance, 5); B) lua_pushstring(LuaInstance, 'TEST'); C) lua_pushlstring(LuaInstance, 'TEST', 4); 已退出,代码:217 应用程序“demo1”异常退出,退出状态为217 对于变体“A”,一切正

代码:

问题:当我使用变体“B”和“C”并在我的iPad上启动project时,应用程序在启动时闪烁,然后关闭,出现下一个错误:

(iPad)控制台日志中的错误:

A) lua_pushnumber(LuaInstance, 5);
B) lua_pushstring(LuaInstance, 'TEST');
C) lua_pushlstring(LuaInstance, 'TEST', 4);
已退出,代码:217
应用程序“demo1”异常退出,退出状态为217
对于变体“A”,一切正常,应用程序正常启动

有趣的是,当我在模拟器上编译和lanch时,所有变体(“A”、“B”、“C”)都可以工作,没有崩溃

有人知道为什么lua_pushstring的应用程序在设备上崩溃吗

可能是某人没有自由地处理这个问题,可能是C++。


请帮帮我。

我注意到,当我将printf添加到func lua_pushlstring时,问题已经解决。为什么?

Exited with code: 217
<Warning> Application 'demo1' exited abnormally with exit status 217
当链接liblua.a时,可能会发生寻址冲突

Exited with code: 217
<Warning> Application 'demo1' exited abnormally with exit status 217
LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {
  lua_lock(L);
  luaC_checkGC(L);
  printf ("Test= %s ", s);  
  setsvalue2s(L, L->top, luaS_newlstr(L, s, len));
  api_incr_top(L);
  lua_unlock(L);
}