rjk / grauel.com (Richard J. Kuhns) wrote in message news:<85zo1oh02r.fsf / moriarity.grauel.com>... > Second, I can't use a dynamically loaded module; it has to be static. Yes, > it's extremely annoying, but I have no choice. The copy protection scheme > used by the third-party library involves "branding" the executable, and > their "branding" program won't touch either a shared object or a binary > that doesn't have their library included. I've already wasted several days > trying to find a way around it :(. > Hi, This is what I did in my game engine. 1 - You must create your extension as it said in the Ruby documentation. You do not have to place the code in the "ext/my_extension" directory because you are not going to compile it with Ruby. You can put it in yours directories or elsewhere. 2 - Compile the code when you compile your application. 3 - Call the function "Init_my_extension()" by hand, in some place in your code. 4 - In Ruby, do not use "require 'my_extension'" because is unneeded. Only, use it because it is already loaded into memory. It is statically linked with your application. 5 - Et voilą” you have an extension statically linked. I hope this help Alberto