Hi,
Ruby exception: /opt/lib/ruby/1.6/i686-linux/digest/md5.so: undefined
Post your configuration, and the commands that you have executed
pigeon% ldd regdb.so
libruby.so.1.6 => /home/ts/local/r167/lib/libruby.so.1.6 (0x40004000)
libdl.so.2 => /lib/libdl.so.2 (0x400b6000)
libm.so.6 => /lib/libm.so.6 (0x400ba000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x400db000)
libc.so.6 => /lib/libc.so.6 (0x40108000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
pigeon%pigeon% cat a.pl
#!/usr/bin/perl -l
use regdb;
$res = regdb::runruby("
require ‘digest/md5’
Digest::MD5.new(‘hello’)
");
print $res;
pigeon%pigeon% perl a.pl
5d41402abc4b2a76b9719d911017c592
pigeon%
Here’s how I built regdb.so, which I call from Perl:
$ make
swig -perl regdb.i
gcc -fPIC -c regdb_wrap.c -I/usr/lib/perl5/5.6.1/i686-linux/CORE
-I/opt/lib/ruby/1.6/i686-linux gcc -fPIC -c regdb.c
-I/opt/lib/ruby/1.6/i686-linux ld -shared regdb_wrap.o regdb.o -o
regdb.so -L/opt/lib -lruby -lm -ldl -lcrypt -export-dynamic $
Ruby was built as:
./configure --enable-shared && make && make install
I’m running:
Ruby 1.67
Perl 5.6.1
swig 1.3
I’ve changed nothing in the base Ruby install; I’ve built Ruby DBI & the
Pg & MySQL drivers.
The error is:
$ perl test.pl
Ruby exception: /opt/lib/ruby/1.6/i686-linux/digest/md5.so: undefined
symbol: rb_cObject - /opt/lib/ruby/1.6/i686-linux/digest/md5.so $
Hope this helps. Let me know if you need any further info.
Best regards,
Peter Munro