So Im messing around with C++ and Lua and it doesn't seem to output errors to the console. Like I could have a lua file of random charaters and no errors are outputted to the console. Any help with this?
Just call the error function from with-in lua instead of the LuaC error function.
[QUOTE=G4MB!T;52731619]Just call the error function from with-in lua instead of the LuaC error function.[/QUOTE]
But if I have a lua file that is just:
[CODE]
this don't work
[/CODE]
How would I get that error message to print out to the console.
Its should be something like
[CODE]
lua: mian.lua:1: '=' expected near 'don'
[/CODE]
[editline]30th September 2017[/editline]
Okay I figured it out. luaL_dofile can act like lua_pcall so you can simply just add a if statement like this
[CODE]
if (luaL_dofile(L, "test.lua"))
{
std::cout << lua_tostring(L, -1) << std::endl;
}
[/CODE]
Sorry, you need to Log In to post a reply to this thread.