int main(int argc, char **argv)
{
ruby_init();
return 0;
}
I have gotten past this several times with ruby 1.6.7 and others, this
is the first time I have gotten this error. This is the first time I
have built with ruby 1.8.
···
On Tue, Feb 25, 2003 at 04:32:02PM +0900, Edward Wilson wrote:
But what do you need the C files for? Everything they provide is in
libruby.{so,a,dll?}.
And the only lib you have to take care of is libruby; the extensions
are handled by Ruby and you don’t have to link against them. Unless you
want to create a single executable with everything, I guess you could then
build Ruby to use static linkage or utilize exerb on Windows.
Thanks for sticking with me on this thread.
I would like to embed ruby inside of a C application. I haven’t found
the examples in the few ruby books that exist to be helpful. I was
told to use rb_protect() as a wrapper, then I discovered that eval.c
the source that defines `rb_protect()’ isn’t included in the standard
batsman@tux-chan:~$ nm --dynamic /usr/lib/libruby.so | grep rb_protect
00021d1c T rb_protect
0000e048 T rb_protect_inspect
binary RPMs, but is in the latest CVS sources. Then what I discovered
^^^^^^ vs ^^^^^^^
was that the make install hack doesn’t install eval.c into the
normal /usr/loca/ruby/src directory as I would have expected it to.
That’s how we got so far into this thread.
‘make install’ is no hack, it belongs to the standard procedure
./configure
make
make install
This generally doesn’t install the sources.
All I want to do is "zooma, zoom zoom and a boom boom" err, start
hacking ruby at the C level without having to case loose files all
over the place. Building extensions was easy; I’m not having the same
luck embedding ruby however. The Ultimate magic would for someone to
post a code snippet that one could clone for their own project. The
examples in books have been foo bar so far.
Normally Ruby isn’t embedded but extended, so you won’t find many examples
of the former. Another approach often used is wrapping legacy code with
SWIG and for instance mapping C++ classes to Ruby, and then controlling
everything from a Ruby script.
···
On Wed, Feb 26, 2003 at 05:33:58AM +0900, Edward Wilson wrote:
On Tue, Feb 25, 2003 at 04:32:02PM +0900, Edward Wilson wrote:
I downloaded the 1.8 source straight from CVS
and the following will not compile.
What error message do you get?
Paul
Thanks for asking:
I’m getting the following error:
`undefined reference to ruby_init()’
My code again is:
#include “ruby.h”
int main(int argc, char **argv)
{
ruby_init();
return 0;
}
I have gotten past this several times with ruby 1.6.7 and others, this
is the first time I have gotten this error. This is the first time I
have built with ruby 1.8.
“Who is General Failure and why is he reading my hard disk?”
Microsoft spel chekar vor sail, worgs grate !!
– Felix von Leitner, leitner@inf.fu-berlin.de