From: Ben Giddings Date: 2005-03-24T06:26:19+09:00 Subject: Re: Stack, Struct and DL Eric Hodel wrote: > You'll have to teach DL what type FOO is. Unfortunately, DL doesn't > barf on you in a friendly way when it can't recognize a type. Nicely phrased. ;) >> [ ------ foo.rb ------ ] >> >> require 'dl/import' >> require 'dl/struct' >> >> module Foo >> extend DL::Importable >> dlload 'foo.dylib' > > > typealias "FOO", "void *" > > Something like this should do it. (Yeah, void * is probably the wrong > type, see dl/types for what types dl knows about.) Actually, "void *" is probably right. When I wrapped my DLL using Ruby/DL I just used "void *" whenever I came across a type that I hadn't taught DL about. That seemed to do the trick for me. Also (I'm no DLL expert or anything) but with GCC I think you have to specify position independent code (-fPIC) and some other nifty things. Make sure the problem is a DL problem, not a problem with the original DLL. Ben