lua-users home
lua-l archive

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


Hello! Is it intended that in stacktraces standard C functions are
sometimes reported as `_G.function` and sometimes simply as
`function`? E.g. trying lua -e 'error("msg")' on the command line
sometimes gives

lua: (command line):1: msg
stack traceback:
    [C]: in function 'error'
    (command line):1: in main chunk
    [C]: in ?

and sometimes

lua: (command line):1: msg
stack traceback:
    [C]: in function '_G.error'
    (command line):1: in main chunk
    [C]: in ?

Peter


On Fri, Dec 12, 2014 at 3:10 PM, Alek Paunov <alex@declera.com> wrote:
> Hi Charles,
>
> On 12.12.2014 13:01, ForthCAD wrote:
>>
>> I compile LUAC.exe linked LUA.DLL _dynamic library_.
>> Probably, there would be no error when linking with the a LUA.lib static
>> library.
>>
>> I think the problem is that 'luaU_dump', 'luaP_opmodes', 'luaP_opnames'
>> are
>> not exported from DLL.
>>
>> For instance, the 'luaU_dump' look like :
>>
>>    int luaU_dump(lua_State *L, const Proto *f, lua_Writer w, void *data,
>>                int strip) {
>>    ...
>>    }
>>
>> But, to link with DLL, should be:
>>
>>    LUA_API int luaU_dump(lua_State *L, const Proto *f, lua_Writer w, void
>> *data,
>>                int strip) {
>>    ...
>>    }
>>
>
> The same patch could be seen in current Fedora packaging of Lua:
>
> http://pkgs.fedoraproject.org/cgit/lua.git/tree/lua-5.2.2-luac-shared-link-fix.patch
>
> Kind regards,
> Alek
>
>