From: Sean Middleditch Date: 2002-01-11T23:22:02+09:00 Subject: Re: Extension with C++ On Fri, 2002-01-11 at 00:03, Mahina wrote: > I'm a beginner in programming Ruby. > I want to use it for my works. > But i have a problem. I didn't understand, how extend Ruby with C++. > Though i already read chapter "Extending Ruby" in Programming Ruby. > What can you advice me? It's actually not all that difficult; you just need to make C wrappers for the C++ methods you want your Ruby code to call. I'm not sure, but I think some of the auto-wrapper generators (like SWIG) will handle this for you. For a non-swig example, I can point you to AweMUD, http://awemud.awesomeplay.com. If you grab the latest release (*not* CVS) there is a Ruby extension, that has some very basic wrappers for the C++ objects in my code. It was pretty easy to put together, just a bit tedious to write all those routines... Sean Etc.