Dylib or Bundle on OS X?

  • Thread starter Shane Liesegang
  • Start date
S

Shane Liesegang

Background: I'm trying to embed a Ruby interpreter in my C++
application. (I know, join the club, right?) My query to (and helpful
response from) the SWIG user list is here:
<http://www.nabble.com/Embedded-interpreter-with-shared-objects-tf4026656.html>
(there's some sample code there as well)

In short, I've got a singleton in C++ which I'm trying to reflect out
into Ruby. The problem is that the Ruby interpreter loads up a second
copy of the library so that the singleton isn't properly shared across
C++ and Ruby. The SWIG list recommended splitting off the wrapped
classes into their own dynamic library that both the executable and the
Ruby module can include.

I'm not sure, though, how to bind the code up in such a way that both an
OS X application and Ruby would be happy working with it. Ruby wants a
bundle, and my attempts to link the dylib into a bundle have just
yielded bad memory access when I try and require it.

Can anyone offer some insight on the best way to accomplish this? Should
I be looking at Frameworks or some other tech instead, or is there a
good way to set up a bundle that references a dylib so that Ruby can
load it as a module?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top