Folks, How do I load this C bundle into MacRuby? file beagle.so beagle.so: Mach-O 64-bit bundle x86_64 ls -la beagle.bridgesupport -rw-r--r-- 1 joelr staff 15428 Jan 14 19:05 beagle.bridgesupport Thanks, Joel --- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
This is what I did to make it work... file beagle.so beagle.so: Mach-O 64-bit bundle x86_64 Note that beagle.so is a bundle so I can't link against it. beagle.c is a file that loads the bundle and sets up function pointers to call into it. --- BeagleBundle.c --- #include "beagle.h" void Init_Beagle(void) { } ---- gcc BeagleBundle.c beagle.c -bundle -o Beagle.bundle irb(main):002:0> require 'Beagle' => true irb(main):003:0> load_bridge_support_file 'beagle.bridgesupport' => main Voila! --- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
Not all is peachy :-(. macirb -r beagle.rb irb(main):001:0> bg_open(0) Assertion failed: (cache->as.fcall.imp != NULL), function rb_vm_dispatch, file dispatcher.cpp, line 766. Abort trap cat beagle.rb #!/usr/bin/env macruby require 'Beagle' load_bridge_support_file 'beagle.bridgesupport' --- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
require './Beagle.bundle' makes all the difference. Why? ls -la Beagle.bundle -rwxr-xr-x 1 joelr staff 21800 Jan 14 20:45 Beagle.bundle file Beagle.bundle Beagle.bundle: Mach-O 64-bit bundle x86_64 On Jan 14, 2011, at 8:49 PM, Joel Reymont wrote:
Not all is peachy :-(.
macirb -r beagle.rb irb(main):001:0> bg_open(0) Assertion failed: (cache->as.fcall.imp != NULL), function rb_vm_dispatch, file dispatcher.cpp, line 766. Abort trap
cat beagle.rb #!/usr/bin/env macruby
require 'Beagle'
--- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
participants (1)
-
Joel Reymont