how to open Lua standard libraries?

7 views
Skip to first unread message

张育玮

unread,
Nov 19, 2013, 11:32:33 AM11/19/13
to lutok-...@googlegroups.com
i use lutok to bind my lua code in my c++ program, it work great.

but when i want to use require, it report me "attempt to call global 'require' (a nil value)"

and i can't found luaL_openlibs in lutok... 

so, please help me to fix it.

Julio Merino

unread,
Nov 21, 2013, 6:17:32 PM11/21/13
to lutok-...@googlegroups.com
On Tue, Nov 19, 2013 at 11:32 AM, 张育玮 <cos...@gmail.com> wrote:
> i use lutok to bind my lua code in my c++ program, it work great.
>
> but when i want to use require, it report me "attempt to call global
> 'require' (a nil value)"
>
> and i can't found luaL_openlibs in lutok...

Please try state::open_base() instead. I think that should do the trick for you.

--
Julio Merino / @jmmv
Reply all
Reply to author
Forward
0 new messages