# Ruby Extensions

**URL:** <https://www.ruby-forum.com/t/ruby-extensions/102163>\
**Category:** Ruby\
**Created:** [August 11, 2006, 11:14pm UTC](https://www.ruby-forum.com/t/ruby-extensions/102163 "2006-08-11T23:14:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rtijoriwala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/df705f/32.png) [@rtijoriwala](https://www.ruby-forum.com/u/rtijoriwala)\
**Post date:** [August 11, 2006, 11:14pm UTC](https://www.ruby-forum.com/t/ruby-extensions/102163/1 "2006-08-11T23:14:06Z")

</div>

Hello All,  
I need to wrap/extend my C++ header file to be able to use it from Ruby.  
The header file depends on other header files as well. But the only  
functionality I desire to use in from Ruby is from the original header  
file. Is it necessary to wrap all include header files as well or just  
wrapping the main header file will do the trick…

Thanks,  
Ritesh.

---

<div class="post-metadata">

**Author:** ![rtijoriwala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/df705f/32.png) [@rtijoriwala](https://www.ruby-forum.com/u/rtijoriwala)\
**Post date:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/ruby-extensions/102163/2 "2006-08-15T14:17:50Z")

</div>

Ritesh T. wrote:

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

You could use SWIG to wrap just this header file. Only the classes and  
functions you want to access need be provided to make the binding. See  
the SWIG documentation for details.

Alternatively, you can create a C interface (no C++) and use Ruby/DL to  
use the library without a binding.
