From: Gareth Reeves Date: 2006-03-11T22:58:08+09:00 Subject: Re: C++ DLL example Mark Volkmann wrote: > Can someone point me to a simple example of calling a C++ function from > Ruby? > I know how to do it with SWIG, but I'm trying to learn how to do it > without SWIG. > I'd like to do this under Windows and have the C++ code in a DLL. > No Windows APIs will be invoked. I just want to do something simple in > C++ like this > > static void greet(const string& name) { > cout << "Hello " << name << endl; > } > > and invoke the greet function from Ruby. > > I know how to build a DLL using VC++ 8. > I suspect the issue is that I don't have the right setup in my .cpp > file. I had a question on C++ extensions that contained some code examples. Its here http://www.ruby-forum.com/topic/57404#new. Gareth -- Posted via http://www.ruby-forum.com/.