I got some error when my code is about:
const char* file = "/app_home/data/minigames/mg_hint_machine_2.lua";
PRINTF("File : %s\n", file);
luaL_dostring(LS, file);
PRINTF("RET(File) : %s\n", lua_tostring(LS,-1));
and output is :
File : /app_home/data/minigames/mg_hint_machine_2.lua
RET(File) : [string “/app_home/data/minigames/mg_hint_machine_2.lua”]:1: unexpected symbol near ‘/’
I’m pretty sure about my path. Additionally I don’t know what symbol that unexpected or
I miss something.
You want
luaL_dofileinstead ofluaL_dostring.luaL_dostring– tries to execute the string as lua code.luaL_dofile– tries to execute the file that the string points to as lua code.