Archive for the 'Ruby' Category

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.