Here I go again with some (idiotic) embedding questions (yeah, I’ve read
README.EXT and I’ve scanned through the mailing list for similar
topics). First of all, I’m getting pretty cool with extending Ruby with
C (not by using SWIG, but by doing all by hand). Now, say I’ve written
some C code which extends Ruby with class Test. Now, say I embedd Ruby
in my app. Would I be able to create some objects in Ruby (the embedded
one) of type Test? How can that be done? For example, in order to create
an array, you would write something like:
VALUE array = rb_ary_new();
Now, how can I do that for the class I’ve just exported into Ruby?
Hope I made myself clear.
P.S. Now, this might be really IDIOTIC, but why do I get “undefined
reference” errors when I try to links against libruby? I’m using gcc
2.95.3 and glibc 2.2.1. I’m using something like gcc -o test
-I/usr/lib/i386-linux -L/usr/lib/i386-linux -lruby main.c
This e-mail was scanned by RAV AntiVirus!
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.
Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor. Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat de virusi.
Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants. Please be aware that there is a risk involved whenever opening e-mail attachments to your computer and that MobiFon is not responsible for any damages caused by viruses.