We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have some code that embeds terra in a c program, it was written several years ago and worked at the time.
With the current release of terra, when I try to terra_loadbuffer or terra_loadstring or terra_dostring, the program bails out with the message:
terra/src/llex.cpp:94: void luaX_pushtstringtable(terra_State*): Assertion `!lua_isnil(L->L, -1)' failed.
Is there a new canonical example of how to embed Terra in a c/c++ program?
An example of this failing would be:
lua_State *lua_state = luaL_newstate(); if (lua_state == nullptr){ cout << "cannot init lua state" << endl; return 5; } luaL_openlibs(lua_state); terra_init(lua_state); terra_loadstring(lua_state,R"(print("Hello, Lua!") )");
where the program crashes at the terra_loadstring call
The text was updated successfully, but these errors were encountered:
Is it possible you changed what LuaJIT you were building against? I don't think this interface has changed, as far as I'm aware.
The couple of examples I'm seeing in the test suite are similar to what you're doing:
https://github.com/terralang/terra/blob/cff49cb29654c88e5d1ea3484e22bc77a80e58e2/tests/multiterra.t
https://github.com/terralang/terra/blob/cff49cb29654c88e5d1ea3484e22bc77a80e58e2/tests/dynlib.t
The error handling in the latter example suggests maybe you're missing that?
Sorry, something went wrong.
No branches or pull requests
I have some code that embeds terra in a c program, it was written several years ago and worked at the time.
With the current release of terra, when I try to terra_loadbuffer or terra_loadstring or terra_dostring, the program bails out with the message:
terra/src/llex.cpp:94: void luaX_pushtstringtable(terra_State*): Assertion `!lua_isnil(L->L, -1)' failed.
Is there a new canonical example of how to embed Terra in a c/c++ program?
An example of this failing would be:
where the program crashes at the terra_loadstring call
The text was updated successfully, but these errors were encountered: