http://qs321.pair.com?node_id=1169315


in reply to Re^2: With Inline::C, how to link to external library? (XS)
in thread With Inline::C, how to link to external library?

See the "Dynamic Linking" section of "perl -V". My first thought was that you may need to specify changes/additions to one or more of ccdlflags, cccdlflags, and lddlflags, perhaps dropping parts of what you specified to be added to CCFLAGS.

But, after several tries, I finally did find the actual error amid all of the context information:

error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’ # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unu +sed__) ^

Which sounded like a C preprocessor directive was being interpreted as C code. But then I realized that this was just more (actually helpful) context information and the location of the error was actually shown as:

perl_pl_b1a3.c:163:1: note: in expansion of macro ‘XS_EXTERNAL’ XS_EXTERNAL(boot_perl_pl_b1a3); /* prototype to pass -Wmissing-protot +ypes */ ^

Which tells me that you need to look at the line(s) before that, line 162 of perl_pl_bla3.c, where you are likely missing some terminating punctuation, like a ';'. Or you have some unclosed construct (like a comment or quoted string or such). The error could be further up from line 162, of course, and perhaps even in some other file (if line 163 is almost immediately preceeded by an #include, for example).

I didn't notice any mistakes that would explain this problem in the C code that you posted.

But I was surprised at a very specific path to your typemap definitions:

'TYPEMAPS' => [ '/home/pi/perl5/perlbrew/perls/perl-5.24.0/lib/5.24.0/ExtUtils/typ +emap' ],

- tye