You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"One", "Two"} is a table. const Strings& is a std::vector<std::string>. C++ containers are not automatically serialized as tables unless explicitly requested, due to Long Standing Issues and Lots of Bikeshedding™.
If you would like sol2 to recognize something as a table, you need to wrap the arguments with sol::as_table/sol::as_table_t or sol::nested, as demonstrated in this example.
Specifically, you can add a call to your binding that looks like:
Hi.
I have exported a class, its methods and the class' instance to Lua using the following example: http://sol2.readthedocs.io/en/latest/tutorial/cxx-in-lua.html
Here is how I did it: https://github.com/kornerr/cpp-callback-script/blob/master/main.cpp#L58
The script is a single line:
env:call("module", {"One", "Two"})
However, I only get "Segmentation fault".
Any idea what I'm doing wrong?
The text was updated successfully, but these errors were encountered: