Subject:
Re: [ruby-ffi] Glib with threads
From:
Hongli Lai
Date:
12/12/09 8:35 AM
To:
ruby-ffi

On Sat, Dec 12, 2009 at 5:34 AM, Christoph Kappel <unexist@dorfelite.net> wrote:
> Hello,
>
> any idea why this doesn't work?
>
> require "ffi"
>
> module
> Glib
>  extend
> FFI::Library
>  ffi_lib "libglib-2.0"
>
>  attach_function :thread_init, :g_thread_init,
> [ :pointer ], :void
> end
>
> I am getting following error:
>
> /usr/lib/ruby/gems/1.9.1/gems/ffi-0.4.0/lib/ffi/library.rb:62:in
> `attach_function': Function 'g_thread_init' not found in
> [libglib-2.0.so] (FFI::NotFoundError)
>        from glib.rb:6:in `<module:FFIGlib>'
>        from glib.rb:3:in `<main>'
>
> I can use g_thread_init in a C program, I verified this before
> posting. So this symbol exists in the glib lib.

I think it's defined in libgthread, not libglib.

-- Phusion | The Computer Science Company Web: http://www.phusion.nl/ E-mail: info@phusion.nl Chamber of commerce no: 08173483 (The Netherlands)