lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

I am trying to register a C++ object method to be called from the lua enviroment
but I am getting the following warning:

ev_lua_engine.cpp: In method `LuaEngine::LuaEngine(char *)':
ev_lua_engine.cpp:95: warning: converting from `void (LuaEngine::*)()' to `void
(*)(lua_State *)'

Look at how I am doiing this:

lua_register(LuaState, "ev_trap", this->EngineExec);

This was the line 95.

LuaState is a lua_State * variable which holds my enviromnet state (Iam currently
 using LuaNG);

EngineExec is a method of my class LuaEngine.

If I register a C pure  function everything works fine.

Does anyone know the correct way to register a C++ method?

Thanks in advance.

Flavio Spolidoro.