From 92f12952efb2225ac96dd5a1b9ea276874daeffe Mon Sep 17 00:00:00 2001 From: Hanjoung Lee Date: Wed, 6 Mar 2019 00:07:01 +0900 Subject: [PATCH] Add opening base lib in cxx-in-lua.rst Loading `sol::lib::base` is needed since the corresponding lua file uses `print` and `assert`. --- docs/source/tutorial/cxx-in-lua.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/tutorial/cxx-in-lua.rst b/docs/source/tutorial/cxx-in-lua.rst index 701ddf69..fe4f0731 100644 --- a/docs/source/tutorial/cxx-in-lua.rst +++ b/docs/source/tutorial/cxx-in-lua.rst @@ -98,6 +98,8 @@ To do this, you bind things using the ``new_usertype`` and ``set_usertype`` meth int main () { sol::state lua; + lua.open_libraries(sol::lib::base); + // note that you can set a // userdata before you register a usertype, // and it will still carry