Forum: Ruby on Rails Wrapping C++ dll in ruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
on 2007-04-27 17:15
(Received via mailing list)

I'm fairly new to RoR (and Ruby), so please forgive me my possible
stupid questions.

I have a C++ dll which is like a clientside-accespoint to some
webservices (for security reasons). Now I want to address the dll from
ruby code, cause I want to do some functional testing on the services
it implements.

I read a reference to Ruby Native on
but I 'm not sure this is what I want

so anybody has an idea, that would be great...
Pau Garcia i Quiles (Guest)
on 2007-04-27 19:16
(Received via mailing list)

Wrapping a C++ DLL is not /that/ difficult but it is not straight.

Ruby is only able to access C (read the README.EXT file in the Ruby
source code), therefore you need to wrap you C++ in C:

Ruby -> C -> C++

You might want to try SWIG (, which creates
bindings with little effort. The problem with SWIG is the code does
not feel like Ruby.

Depending on how comprehensive you need your bindings to be and how
Ruby you want them to be, it might be easier/better you just write a
few C functions wrapping the C++ clasess and methods you need.

I don't know if it's going to help you, but Ruby/DLX might be useful

Pau Garcia i Quiles
(Due to the amount of work, I usually need 10 days to answer)

Quoting "removed_email_address@domain.invalid" 
Juan T. (Guest)
on 2007-04-28 03:46
(Received via mailing list)
You can also try . It
has some
good examples of C++ objects bing used in Ruby.
on 2007-04-30 10:28
(Received via mailing list)
Thanks a lot!

This topic is locked and can not be replied to.