in reply to perlxs and gcc error

I don't know whether this is line 19, but in
value=value+in_matrix[i][a]*in_matrix[j][a];

you are assuming in_matrix is an array of pointers. However, you have declared in_matrix to be double &in_matrix. Are you sure you don't want double ** in_matrix here?

Abigail

Replies are listed 'Best First'.
Re: Re: perlxs and gcc error
by Anonymous Monk on Feb 11, 2003 at 12:38 UTC
    Yes, that would be what i want to do. However if i change "double &in_matrix" to "double ** in_matrix", this happens:
    $ make /usr/bin/perl -I/usr/lib/perl5/5.6.1/i386-linux -I/usr/lib/perl5/5.6.1 + /usr/lib/perl5/5.6.1/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.6.1/ +ExtUtils/typemap test_c.xs > test_c.xsc && mv test_c.xsc test_c.c Error: 'double **' not in typemap in test_c.xs, line 8 make: *** [test_c.c] Error 1
      The typemap is a mapping from C types to Perl internal types. There are many predefined types, but as you can imagine, it would be impossible to list them all. It looks like double ** isn't in the typemap (which doesn't quite surprise me). So, you have to either extend the typemap, or use the appropriate Perl internal types.

      I don't know how to extend the typemap. My knowledge of XS is extremely limited.

      Abigail