Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Issue with CPAN module not building

by zbuser (Initiate)
on Aug 01, 2013 at 15:57 UTC ( #1047480=perlquestion: print w/ replies, xml ) Need Help??
zbuser has asked for the wisdom of the Perl Monks concerning the following question:

I have run into an issue attempting to build the CPAN module Newt-1.08. The Newt.xs/Newt.c module fails compilation. A project I have been trying to port uses Newt.

The system is running Redhat EL6, the compiler is gcc 4.4.7. Here is the relevant error message:

gcc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack +-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BI +TS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack +-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION= +\"1.08\" -DXS_VERSION=\"1.08\" -fPIC "-I/usr/lib64/perl5/CORE" Newt +.c Newt.xs: In function ‚constant‚: Newt.xs:99: warning: ‚return‚ with no value, in function returning non +-void Newt.xs:658: warning: label ‚not_there‚ defined but not used Newt.c: In function ‚XS_Newt_va_end‚: Newt.c:765: error: cast specifies array type Newt.c: In function ‚XS_Newt_newtFormRun‚: Newt.xs:1041: warning: unused variable ‚sv‚ Newt.c: In function ‚XS_Newt_newtButtonBarv‚: Newt.c:3442: error: cast specifies array type Newt.c: In function ‚XS_Newt_newtWinMessagev‚: Newt.c:3528: error: cast specifies array type make: *** [Newt.o] Error 1

The portion of the Newt.c program relevant to the first error at line 765 is (actual error is set off with dashes):

XS(XS_Newt_va_end); /* prototype to pass -Wmissing-prototypes */ XS(XS_Newt_va_end) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "arg0"); { __gnuc_va_list arg0; -------------------------- if (sv_derived_from(ST(0), "__gnuc_va_list")) { IV tmp = SvIV((SV*)SvRV(ST(0))); arg0 = INT2PTR(__gnuc_va_list,tmp); -------------------------- } else Perl_croak(aTHX_ "%s: %s is not of type %s", "Newt::va_end", "arg0", "__gnuc_va_list"); va_end(arg0); } XSRETURN_EMPTY; }

So how did this compile in the first place? I am just not seeing what I'm doing wrong.

Comment on Issue with CPAN module not building
Select or Download Code
Re: Issue with CPAN module not building
by tobyink (Abbot) on Aug 01, 2013 at 16:55 UTC

    I'm not especially surprised. Newt hasn't seen a release in almost 15 years. Back then, Perl 5.5 was still the current stable version of Perl. Modern Perls have had API changes since then, so there would probably be problems linking them; also gcc has come a long way since then and that may cause problems too.

    There's only a single PASS result on CPAN testers, so you're not the only person that has had problems.

    If you can track down a machine running Perl 5.6/5.8 and gcc 2.9x, then you might have better luck building it.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Re: Issue with CPAN module not building
by syphilis (Canon) on Aug 02, 2013 at 00:00 UTC
    Is it the cast to SV* that's causing the error ?
    If so, I'd try removing it and see what happens.

    Cheers,
    Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1047480]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2014-09-17 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (99 votes), past polls