lua-users home
lua-l archive

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


Omit the local because ffi is only valid for this one line in
interactive-mode and you should be fine.

On Thu, Mar 8, 2012 at 5:46 PM, Daniel Cegiełka
<daniel.cegielka@gmail.com> wrote:
> Hi,
> I try to run FFI example: http://luajit.org/ext_ffi.html
>
> Does anyone have an idea of what I'm doing wrong.
>
> danice@entropy ~ $ luajit
> LuaJIT 2.0.0-beta9 -- Copyright (C) 2005-2011 Mike Pall. http://luajit.org/
> JIT: ON CMOV SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc fuse
>> local ffi = require("ffi")
>> ffi.cdef[[
>>> int printf(const char *fmt, ...);
>>> ]]
> stdin:1: attempt to index global 'ffi' (a nil value)
> stack traceback:
>         stdin:1: in main chunk
>         [C]: ?
>>
>
> best regards,
> Daniel
>
>