Re: Invalid use of 'static' in linkage specification

[email protected] (muppet)
Newsgroups perl.xs
Message-ID <[email protected]>
On Jan 2, 2012, at 8:54 AM, Alberto Simões wrote:

> Hello
> 
> Although most architectures are compiling my module correctly, I am getting some complains for some random linuxes:
> 
> http://www.cpantesters.org/cpan/report/294f5cfc-3507-11e1-9d6f-f6dbfa7543f5
> 
> http://www.cpantesters.org/cpan/report/c9dafc5a-34fb-11e1-9d6f-f6dbfa7543f5
> 
> http://www.cpantesters.org/cpan/report/1afb75b2-34c3-11e1-9bca-f0349aeef8c6
> 
> They complain about the use of 'static' on the file generated by ExtUtils::ParseXS. But my .xs file doesn't have any 'static' on it, so it is referring to some code generated automatically.
> 
> Any hint on what it might be?

It's hard to say without seeing the generated code.  The error message:

cc -Icld-src -I/home/cpan/pit/bare/perl-5.15.2/lib/5.15.2/x86_64-linux/CORE -fPIC -fPIC -I. -O2 -DCLD_WINDOWS -c -x c++ -O2 -o CLD.o CLD.cc
CLD.cc:178: error: invalid use of 'static' in linkage specification
CLD.cc:179: error: invalid use of 'static' in linkage specification
error building CLD.o from 'CLD.cc' at /home/cpan/pit/bare/perl-5.15.2/lib/5.15.2/ExtUtils/CBuilder/Base.pm line 177.

shows that the XS code is being turned into C++ code rather than C code.

It may be that one of the xsubpp macros that expects to expand into a C function is expanding in C++ class scope.


--
Daddy!  Daddy!  Daddy!  Daddy!  What was that question I asked?
  -- Yvonne, confused
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.