From: Francis Cianfrocca Date: 2006-08-05T04:33:23+09:00 Subject: Re: Include existing C/C++ libraries in Ruby. unknown wrote: > On Sat, 5 Aug 2006, Ritesh Tijoriwala wrote: > >> I want to use my existing C/C++ libraries in Ruby and is there a way to >> do that? I tried SWIG but it doesn't work out that good for complex >> objects and methods that I have in my libraries. Any other ways to >> accomplish this? > > you can use them directly with ruby/dl > I used to use ruby/dl a lot, and it's vastly better than the equivalent stuff in Python, although the documentation is inadequate. But more recently I've gotten in the habit of simply writing plain old Ruby extensions (lots of good docs, and they are dead-easy) that wrap my C/C++ code. I think that's the best way, because you can keep all the ugly stuff in C and your Ruby code stays nice and clean. You have to do a certain amount of massaging between the C world and the Ruby world, but it's not hard. Read README.EXT in the ruby source distro. -- Posted via http://www.ruby-forum.com/.