Problem referencing functions in a C DLL using Ruby/DL

D

Dude #2.5

Hi,

I've sucessfully used Ruby/DL to reference a DLL before, however, I've
not been able to figure out this one. It's MITAB DLL
(http://mitab.maptools.org). I'm a little unclear about how I
reference the functions within.

I'm using the extern notations:

extern 'long _mitab_c_getlibversion()'

I've used this same DLL under Borland Delphi, and usually use this sort
of notation:

A late binding reference would use:

@mitab_c_getlibversion:=
GetProcAddress(MITABDLL_Handle,'_mitab_c_getlibversion@0');

Whereas a static (cdecl) reference would be:

function mitab_c_getlibversion (): longint;

cdecl; external DLL Name 'mitab_c_getlibversion'
;

Under Ruby, I've tried a number of combinations, but always get either:

symbol': can't find the symbol `_mitab_c_getlibversion@0'
(RuntimeError)

or

a parser error.

I did update Ruby/DL's import.rb to accept the "@0" notation (which I
believe indicates the "size" of the parameters taken by the function),
but that hasn't helped any. (My change only went as far as updating
the regex so that the notation was accepted, maybe I need to do more to
actually put it to use.)

One twist is that I think this is a C++ DLL, with externs for C, but
I've not found anything that indicates how this would impact my
bindings.

Any help or pointers would be greatly appreciated.

Thanks.

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
DewittMill
Top