From: Paul Brannan Date: 2002-09-09T23:19:41+09:00 Subject: Re: HOWTO create Ruby bindings for a library On Mon, Sep 09, 2002 at 11:11:19PM +0900, Lyle Johnson wrote: > Tom Sawyer wrote: > > > Ruby/DL > > http://kt-www.jaist.ac.jp/~ttate/ruby/ruby-dl.html > > I haven't tried it yet, so I'm curious: how well does Ruby/DL deal with > C++ libraries? That is, can you construct C++ objects, call overloaded > functions, etc.? Probably not well, considering there's no well-accepted standard for how C++ compilers mangle names of member functions. If you correctly mangle the name, and you happen to call the function using the correct calling convention, and you look the function up properly in the vtable (if it is a virtual function), and you happen to correctly catch any exception that it throws and translate it into a Ruby exception, then you might be off to a good start. You're probably better off using SWIG or wrapping the C++ code by hand. Paul