Ruby DL

I’ve been meaning to learn Ruby for a while, and I finally found a suitable project. So far my experience has been fairly good. I ran into one particularly annoying problem with the DL library, which is an otherwise cool way to make calls into dynamic libraries. Before you can do this, you’ve got to tell Ruby what the function prototype looks like. That’s where I ran into this gem:


extern "int foo( char * )" # doesn't work
extern "int foo(char *)" # works

The error message is absolutely worthless, so you essentially have to discover this by trial and error.

Advertisements

1 Response to “Ruby DL”


  1. 1 Matt December 1, 2006 at 9:01 am

    Thanks, I thought i was going crazy.. there needs to be more documentation of the dl lib.


Comments are currently closed.




%d bloggers like this: