From: ts Date: 2002-06-12T20:49:07+09:00 Subject: Re: Embedding Ruby (again) >>>>> "R" == Radu M =?iso-8859-1?b?T2JhZOM=?= writes: R> one) of type Test? How can that be done? For example, in order to create R> an array, you would write something like: R> VALUE array = rb_ary_new(); R> Now, how can I do that for the class I've just exported into Ruby? Well, in ruby you just write (if your class is in test.rb) require "test" a = Test.new now in C this give rb_require("test"); tt_cTest = rb_const_get(rb_cObject, rb_intern("Test")); a = rb_funcall2(tt_cTest, rb_intern("new"), 0, 0); R> P.S. Now, this might be really IDIOTIC, but why do I get "undefined R> reference" errors when I try to links against libruby? I'm using gcc R> 2.95.3 and glibc 2.2.1. I'm using something like gcc -o test R> -I/usr/lib/i386-linux -L/usr/lib/i386-linux -lruby main.c Look at [ruby-talk:36676] to find the flags http://www.ruby-talk.org/36676 Guy Decoux