I am trying to register a c++ function in Lua.
But getting this error:
CScript.cpp|39|error: argument of type \'int (CScript::)(lua_State*)\' does n
You can not use a method of a class as a normal function, unless it is declared static. You have to define a normal function, which finds out what object you want the method to be called in, and then call the method.
The main reason it's not possible to use a class method as a callback from a C function (and remember that the Lua API is a pure C library), is because the computer doesn't know which object the method should be called on.