Gluecode (C++ and Ruby)

May 3, 2013

Install swig via package manager on ubuntu

Further packages needed

create a file called “example.i” with the following content

now create the file “example.cxx” which contains:



if everything works right you should have a file “example_wrap.cxx” in your directory

run the following to find your right header file ruby.h

its a path like “/usr/lib/ruby/1.8/i686-linux/ruby.h”

compile your wrapper file

now you have to link the files

write a testfile or test on irb

you should see the output

Tags: ,

Leave a Comment

You must be logged in to post a comment.