[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

calling double rb_genrand_real(void); failing

Christophe Mckeon

8/11/2008 7:29:00 PM

hi,

there is a function prototype:

double rb_genrand_real(void);

in intern.h which is included by ruby.h

i'd like to call this function from C
directly rather that calling the rand
method in order avoid unnecessary overhead.
i'm not really sure why i am getting this
at run time though:

dyld: lazy symbol binding failed: Symbol not found: _rb_genrand_real
Referenced from:
/Library/Ruby/Gems/1.8/gems/drp-0.9.0/lib/drp_main_ext.bundle
Expected in: dynamic lookup

dyld: Symbol not found: _rb_genrand_real
Referenced from:
/Library/Ruby/Gems/1.8/gems/drp-0.9.0/lib/drp_main_ext.bundle
Expected in: dynamic lookup

shouldn't all functions included through
ruby.h be available?

thanks,
_c
--
Posted via http://www.ruby-....

3 Answers

Tim Hunter

8/11/2008 9:13:00 PM

0

Christophe Mckeon wrote:
> hi,
>
> there is a function prototype:
>
> double rb_genrand_real(void);
>
> in intern.h which is included by ruby.h
>
> i'd like to call this function from C
> directly rather that calling the rand
> method in order avoid unnecessary overhead.
> i'm not really sure why i am getting this
> at run time though:
>
> dyld: lazy symbol binding failed: Symbol not found: _rb_genrand_real
> Referenced from:
> /Library/Ruby/Gems/1.8/gems/drp-0.9.0/lib/drp_main_ext.bundle
> Expected in: dynamic lookup
>
> dyld: Symbol not found: _rb_genrand_real
> Referenced from:
> /Library/Ruby/Gems/1.8/gems/drp-0.9.0/lib/drp_main_ext.bundle
> Expected in: dynamic lookup
>
> shouldn't all functions included through
> ruby.h be available?
>
> thanks,
> _c

You don't say which version of Ruby you're using, but in my 1.8.6 patch
111 source code there is no such function.

--
RMagick: http://rmagick.ruby...

Tim Hunter

8/11/2008 10:42:00 PM

0

Tim Hunter wrote:
> You don't say which version of Ruby you're using, but in my 1.8.6 patch
> 111 source code there is no such function.

Ah, I see it defined in 1.9.0. Are you sure you're linking with the 1.9
library?
--
Posted via http://www.ruby-....

Christophe Mckeon

8/11/2008 11:27:00 PM

0

Tim Hunter wrote:
> Tim Hunter wrote:
>> You don't say which version of Ruby you're using, but in my 1.8.6 patch
>> 111 source code there is no such function.
>
> Ah, I see it defined in 1.9.0. Are you sure you're linking with the 1.9
> library?

doh, thanks for that. i was mistakenly browsing 1.8.7 sources,
which also include the prototype, and linking against 1.8.6

regards,
_c
--
Posted via http://www.ruby-....