lua-users home
lua-l archive

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


Yang Fan wrote:
        /* push functions and arguments */
        lua_getglobal(L, "main");    /* function to be called */
        lua_pushlstring(L, m_data.c_str(), m_data.size());

        /* do the call (1 arguments, 0 result) */

error msg showed:Error running function "main": attempt to call a string value


I think that the line after lua_getglobal is not necessary. You already have the function on the stack (given that lua_getglobal succeeded).