[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: trouble accessing global from C
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 8 Jan 2001 17:24:17 -0200 (EDT)
It's hard to tell what is wrong, assuming that in main.cpp you have lua_open.
Could you please post or send me the smallest program that shows this problem?
Thanks.
--lhf
>I've been writing C function that needs access to Lua global variable.
>I use
> lua_getglobal(L, "session");
>but it returns `nil'.
>
>But I *have* global `session' var. I even done setglobal("session", session)!
>
>Execution goes as this
>
>main.cpp:
>register(c-func)
>dofile(main.lua)
>
>main.lua:
>session={...}
>call c-func