Here is the runtime error I get from ncurses-0.9.1:
dyld: lazy symbol binding failed: Symbol not found: _STR2CSTR
Referenced from:
/Users/rahul/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/x86_64-darwin10/ncurses.bundle
Expected in: flat namespace dyld:
Symbol not found: _STR2CSTR
Referenced from:
/Users/rahul/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/x86_64-darwin10/ncurses.bundle
Expected in: flat namespace
Trace/BPT trap
Someone told me that STR2CSTR has been removed. Could someone tell me
what I should replace STR2CSTR with in the ncurses code, or what to do.
I am not familiar with the Ruby-C interface, and would appreciate some
pointers.
thanks,
rahul
p.s. I am using an older version of ncurses, since i can't get 1.2.4 to
compile or run on Snow Leopard.
Actually STR2CSTR was marked as obsolete in 1.8 and removed in 1.9.1.
ruby.h:
/* obsolete API - use StringValue() */
char *rb_str2cstr _((VALUE,long*));
/* obsolete API - use StringValuePtr() */ #define STR2CSTR(x) rb_str2cstr((VALUE)(x),0)
Basically just replace STR2CSTR by StringValuePtr or define this macro.
Wbr
Christoph
···
---- On Sat, 21 Aug 2010 08:17:32 +0200 R.. Kumar 1.9.1 OSX wrote ----
Someone told me that STR2CSTR has been removed. Could someone tell me
what I should replace STR2CSTR with in the ncurses code, or what to do.
I am not familiar with the Ruby-C interface, and would appreciate some
pointers.
Someone told me that STR2CSTR has been removed. Could someone tell me
what I should replace STR2CSTR with in the ncurses code, or what to do.
I am not familiar with the Ruby-C interface, and would appreciate some
pointers.
Actually STR2CSTR was marked as obsolete in 1.8 and removed in 1.9.1.
ruby.h:
/* obsolete API - use StringValue() */
char *rb_str2cstr _((VALUE,long*));
/* obsolete API - use StringValuePtr() */ #define STR2CSTR(x) rb_str2cstr((VALUE)(x),0)
Basically just replace STR2CSTR by StringValuePtr or define this macro.
Wbr
Christoph
I've tried various combinations. I either get runtime errors relating to
rb_str2ctr or just make errors.
1. $ perl -p -i.b -e 's/STR2CSTR/StringValuePtr/g' *.c
$ make
form_wrap.c: In function ‘rbncurs_c_set_field_type’:
form_wrap.c:626: error: lvalue required as unary ‘&’ operand
form_wrap.c: In function ‘rbncurs_c_set_field_fore’:
form_wrap.c:698: warning: implicit conversion shortens 64-bit value into
a 32-bit value
form_wrap.c: In function ‘rbncurs_c_set_field_back’:
form_wrap.c:712: warning: implicit conversion shortens 64-bit value into
a 32-bit value
form_wrap.c: In function ‘make_arg’:
form_wrap.c:1134: warning: format not a string literal and no format
arguments
make: *** [form_wrap.o] Error 1
···
---- On Sat, 21 Aug 2010 08:17:32 +0200 R.. Kumar 1.9.1 OSX wrote ----
Someone told me that STR2CSTR has been removed. Could someone tell me
what I should replace STR2CSTR with in the ncurses code, or what to do.
I am not familiar with the Ruby-C interface, and would appreciate some
pointers.
Actually STR2CSTR was marked as obsolete in 1.8 and removed in 1.9.1.
ruby.h:
/* obsolete API - use StringValue() */
char *rb_str2cstr _((VALUE,long*));
/* obsolete API - use StringValuePtr() */ #define STR2CSTR(x) rb_str2cstr((VALUE)(x),0)
Basically just replace STR2CSTR by StringValuePtr or define this macro.
Wbr
Christoph
On a fresh copy I placed the above lines, in the ncurse_wrap.h file.
"make" worked, I created a gem and installed the gem. (I placed the
lines above #include <ruby.h> else i get compilation errors.)
Upon execution of any sample I get: dyld: lazy symbol binding failed:
Symbol not found: _rb_str2cstr
Perhaps, I am placing these lines in the wrong place. I tried placing in
the .c file but i get the same run time error.
···
---- On Sat, 21 Aug 2010 08:17:32 +0200 R.. Kumar 1.9.1 OSX wrote ----
Someone told me that STR2CSTR has been removed. Could someone tell me
what I should replace STR2CSTR with in the ncurses code, or what to do.
I am not familiar with the Ruby-C interface, and would appreciate some
pointers.
···
On Sat, Aug 21, 2010 at 7:10 PM, R.. Kumar 1.9.1 OSX <sentinel1879@gmail.com> wrote:
---- On Sat, 21 Aug 2010 08:17:32 +0200 R.. Kumar 1.9.1 OSX wrote ----
Actually STR2CSTR was marked as obsolete in 1.8 and removed in 1.9.1.
ruby.h:
/* obsolete API - use StringValue() */
char *rb_str2cstr _((VALUE,long*));
/* obsolete API - use StringValuePtr() */ #define STR2CSTR(x) rb_str2cstr((VALUE)(x),0)
Basically just replace STR2CSTR by StringValuePtr or define this macro.
Wbr
Christoph
On a fresh copy I placed the above lines, in the ncurse_wrap.h file.
"make" worked, I created a gem and installed the gem. (I placed the
lines above #include <ruby.h> else i get compilation errors.)
Upon execution of any sample I get: dyld: lazy symbol binding failed:
Symbol not found: _rb_str2cstr
Perhaps, I am placing these lines in the wrong place. I tried placing in
the .c file but i get the same run time error.
--
Posted via http://www.ruby-forum.com/\.
--
Michael Fellinger
CTO, The Rubyists, LLC
I check email a couple times daily; to reach me sooner, use: http://awayfind.com/manveru
I've tried various combinations. I either get runtime errors relating to
rb_str2ctr or just make errors.
1. $ perl -p -i.b -e 's/STR2CSTR/StringValuePtr/g' *.c
$ make
form_wrap.c: In function ‘rbncurs_c_set_field_type’:
form_wrap.c:626: error: lvalue required as unary ‘&’ operand
form_wrap.c: In function ‘rbncurs_c_set_field_fore’:
form_wrap.c:698: warning: implicit conversion shortens 64-bit value into
a 32-bit value
form_wrap.c: In function ‘rbncurs_c_set_field_back’:
form_wrap.c:712: warning: implicit conversion shortens 64-bit value into
a 32-bit value
form_wrap.c: In function ‘make_arg’:
form_wrap.c:1134: warning: format not a string literal and no format
arguments
make: *** [form_wrap.o] Error 1
Someone told me that STR2CSTR has been removed. Could someone tell me
what I should replace STR2CSTR with in the ncurses code, or what to do.
I am not familiar with the Ruby-C interface, and would appreciate some
pointers.
Is anything other than ncurses port required to be installed ?
I get:
$ ruby example.rb
.rvm/gems/ruby-1.9.2-head/gems/ffi-0.6.3/lib/ffi/library.rb:61:in `block
in ffi_lib': Could not open library 'libncurses.so.5':
dlopen(libncurses.so.5, 5): image not found. Could not open library
'libncurses.so.5.dylib': dlopen(libncurses.so.5.dylib, 5): image not
found (LoadError)
Someone told me that STR2CSTR has been removed. Could someone tell me
what I should replace STR2CSTR with in the ncurses code, or what to do.
I am not familiar with the Ruby-C interface, and would appreciate some
pointers.
Is anything other than ncurses port required to be installed ?
Seems like it's a bit outdated, I fixed that for you:
Not sure if that works on OSX, but I'm hopeful
···
On Sat, Aug 21, 2010 at 11:37 PM, R.. Kumar 1.9.1 OSX <sentinel1879@gmail.com> wrote:
On Sat, Aug 21, 2010 at 7:10 PM, R.. Kumar 1.9.1 OSX >> <sentinel1879@gmail.com> wrote:
---- On Sat, 21 Aug 2010 08:17:32 +0200 R.. Kumar 1.9.1 OSX wrote ----
I get:
$ ruby example.rb
.rvm/gems/ruby-1.9.2-head/gems/ffi-0.6.3/lib/ffi/library.rb:61:in `block
in ffi_lib': Could not open library 'libncurses.so.5':
dlopen(libncurses.so.5, 5): image not found. Could not open library
'libncurses.so.5.dylib': dlopen(libncurses.so.5.dylib, 5): image not
found (LoadError)