Error at line “luaL_dofile” and debugger doesn’t show anything about error.
I can use command “luaL_dostring” but I don’t know why I can’t dofile.
My code is following:
const char* file = "/app_home/data/minigames/mg_hint_machine_2.lua";
ret = luaL_dofile(LS, file);
if(ret != 0){
PRINTF("Error occurs when calling luaL_dofile() Hint Machine 0x%x\n",ret);
}
else PRINT("\nDOFILE SUCCESS");
and debugger shows error in this line and “ret” still not get returned value from dofile.
If you want to see about error in debugger
02C2D304 7C21016A stdux r1,r1,r0 03 (02C2D300) REG PIPE LSU
Debugger points in this line and I can’t understand it.
As an elaboration on superzilla’s answer (upvote that answer rather than this one),
to get the error message your code needs to look like this:
Your change (in the comments) changed the
luaL_dofileto aluaL_dostring, which is why you’re getting unexpected error message ( as mentioned here ).