Jim Freeze wrote:

> So, the instant gratification worked... but I was not giving
> you the whole story. The real function was:
> 
>   fact2(int *INPUT, char **str);
> 
> After reading your email, I changed this to:
> 
>   fact2(int *INPUT, char **INPUT);
> 
> But compiling and running gives me the error:
> 
>   test.rb:3:in `fact2': Expected char ** (TypeError)
>         from test.rb:3

Right. The typemaps.i file doesn't define a typemap for char **, you'll 
need to roll one yourself (I will provide hints ;)

> So, I changed the header description in the .i file (without
> changing the actual function definition) to:
> 
>   fact2(int *INPUT, char *INPUT);
> 
> Now, it appears to be getting past the initial function 
> parameter passing, but I get the error:
> 
>   ruby test.rb
>   ld.so.1: /tools/apps/ruby/ruby-1.8.0/bin/ruby: fatal: relocation error:
>   file ./example.so: symbol fact2: referenced symbol not found
>   Killed

Right. SWIG interprets this line:

     int fact2(int *INPUT, char *INPUT);

as your saying there's a real function named fact2() that expects two 
arguments, a pointer-to-int and a pointer-to-char. Which of course is 
not the case ;) The real fact2() expects a pointer-to-pointer-to-char as 
its second argument.

So the burning question now, is, what is that 2nd argument to fact2() 
actually supposed to be? Is it intended to be an array of strings? Put 
another way (and perhaps more useful), how would you expect to call this 
function from Ruby?