From: Jim Freeze Date: 2002-11-24T00:39:44+09:00 Subject: Re: How do I add numbers in C? Oops, old code. This IS the code that does not work: > I have the following code to add a number to an instance variable: > static VALUE test_plus(self, y) VALUE self; VALUE y; { VALUE x; num = rb_iv_get(self, "@x"); switch (TYPE(num)) { case T_FIXNUM: x = fix_plus(num, y); case T_BIGNUM: x = rb_big_plus(num, y); case T_FLOAT: x = flo_plus(num, y); default: /* Not implemented. Error? */ return self; } rb_iv_set(self,"@x", x); return self; } > The code compiles, but when I run I get: > > dyld: ruby Undefined symbols: > _fix_plus > _flo_plus > > I couldn't find rb_fix_plus or rb_flo_plus, so I am not > certain I even have the right functions. fix_plus and flo_plus > don't seem to follow the rb__ form. > Can someone point me in the right direction here? > Thanks > > -- > Jim Freeze > -- Jim Freeze ---------- "The subspace _W inherits the other 8 properties of _V. And there aren't even any property taxes." -- J. MacKay, Mathematics 134b