# "Statically linking" native extensions

**URL:** <https://www.ruby-forum.com/t/statically-linking-native-extensions/189210>\
**Category:** Ruby\
**Created:** [May 26, 2010, 9:29pm UTC](https://www.ruby-forum.com/t/statically-linking-native-extensions/189210 "2010-05-26T21:29:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![indigo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/dec6dc/32.png) [@indigo](https://www.ruby-forum.com/u/indigo)\
**Post date:** [May 26, 2010, 9:29pm UTC](https://www.ruby-forum.com/t/statically-linking-native-extensions/189210/1 "2010-05-26T21:29:38Z")

</div>

Hello.

I am writing a small game in ruby, using rubygame to do the graphics. I  
am targeting an audience with little technical experience, which means I  
won’t be using gems, as easy as those are. My perfect scenario is to  
give somebody a CD with a ruby installer and the game on it and have it  
work perfectly. This means that instead of relying on gem to give me  
external libraries, like rubygame or ruby-sdl-ffi (which rubygame  
depends on), and want to store that code in my game’s directory tree.  
This is not particularly hard for rubygame, because it doesn’t include a  
native extension. (I would statically link rubygame by simply copying  
its code into a directory in the game’s directory tree.) ruby-sdl-ffi,  
however, does require one. How would one “statically link” such a gem? I  
have tried to make the game as light on external libraries as possible,  
but graphics are a must. Thanks for your help,

Indigo.

P.S. The game is a simple puzzle game. It requires simple 2d surfaces  
and textures to run, so if you have a better library, please let me  
know.
