[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua C Return problem
- From: Ignacio Burgueño <ignaciob@...>
- Date: Wed, 09 Jan 2008 16:21:46 -0300
Rodrigo Araújo wrote:
This code inside the class gives the following error:
In member function 'int Classe::B(lua_State*)':
317: error: argument of type 'int (Classe::)(lua_State*)' does not match
In member function 'int Classe::A(lua_State*)':
327: error: argument of type 'int (Classe::)(lua_State*)' does not match
Lines 317 and 327 are the lines in which I call lua_pushcfunction. So,
how should I do it? Is it possible to do this?
Seems that your 'drawer' function is a member of your class. If so, you
cannot use pushcfunction because it only allows non-member functions (or
static ones) to be pushed.
You can take a look at Lunar itself. When it registers in Lua your class
functions, it actually registers a function called 'thunk', which
retrieves the member function to be called using upvalues.