Subject:
Re: [ruby-ffi] SYNOPSIS' code of http://github.com/ffi/ffi
From:
Wayne Meissner
Date:
3/29/10 2:10 PM
To:
ruby-ffi@googlegroups.com

The code was broken - you do in fact need the ffi_lib 'c' line now.

Thanks for pointing it out.


On 25 March 2010 11:45, KISHIMOTO, Makoto <ksmakoto@dd.iij4u.or.jp> wrote:
> Hello,
>
> I've tried SYNOPSIS' code of http://github.com/ffi/ffi .
>
> #====
> require 'ffi'
>
> module MyLib
>  extend FFI::Library
>  ffi_lib 'c'                              # insert this line
>  attach_function :puts, [ :string ], :int
> end
>
> MyLib.puts 'Hello boys using libc!'
> #====
>
> Without "ffi_lib 'c'", following error occured.
>
> /usr/local/lib/ruby/gems/1.9.1/gems/ffi-0.6.3/lib/ffi/library.rb:79:in `ffi_libraries': no library specified (LoadError)
>        from /usr/local/lib/ruby/gems/1.9.1/gems/ffi-0.6.3/lib/ffi/library.rb:106:in `attach_function'
>
> The SYNOPSIS' code correct?
>
> To unsubscribe from this group, send email to ruby-ffi+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
>

To unsubscribe from this group, send email to ruby-ffi+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.