Interfacing with a C static library?

Hi,

just curious what is a simplest way to use C functions compiled into a
static library (libc<something>.a) from Ruby ?

I have no acces to shared version of that C-lib so I cann't use standard
DL::dlopen . Only static library and C-header file.

Do I have to manually write wrapper C shared lib, use SWIG or is there
other more straightforward way ?

Take care.

David

···

--
Posted via http://www.ruby-forum.com/.

Without touching Ruby's runtime library, I don't think there is any easy way to use it other than wrapping the static library with a dynamic library. If the static library can somehow be used in Ruby at runtime, the static library will need to be called a dynamic library...

···

On 1/21/2012 12:16 PM, David Unric wrote:
> Hi,
>
> just curious what is a simplest way to use C functions compiled into a
> static library (libc<something>.a) from Ruby ?