mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Add opening base lib in cxx-in-lua.rst
Loading `sol::lib::base` is needed since the corresponding lua file uses `print` and `assert`.
This commit is contained in:
parent
0c095d4090
commit
92f12952ef
|
@ -98,6 +98,8 @@ To do this, you bind things using the ``new_usertype`` and ``set_usertype`` meth
|
||||||
int main () {
|
int main () {
|
||||||
sol::state lua;
|
sol::state lua;
|
||||||
|
|
||||||
|
lua.open_libraries(sol::lib::base);
|
||||||
|
|
||||||
// note that you can set a
|
// note that you can set a
|
||||||
// userdata before you register a usertype,
|
// userdata before you register a usertype,
|
||||||
// and it will still carry
|
// and it will still carry
|
||||||
|
|
Loading…
Reference in New Issue
Block a user