2013-02-03 52 views
0

我無法通過CPAN在OS X Mountain Lion上安裝Perl/Tk。它錯誤與谷歌文件中的錯誤沒有幫助:Perl/Tk不通過CPAN在OS X上構建Mountain Lion

/Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/bin/perl5.17.8 /Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/ExtUtils/xsubpp -typemap /Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/ExtUtils/typemap -typemap /Users/villadelfia/Downloads/Tk-804.030/Tk/typemap IO.xs > IO.xsc && mv IO.xsc IO.c 
Warning: Found a 'CODE' section which seems to be using 'RETVAL' but no 'OUTPUT' section. in IO.xs, line 235 
cc -c -I.. -I/usr/X11R6/include -I/usr/local/include/freetype2 -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O3 -DVERSION=\"804.03\" -DXS_VERSION=\"804.03\" "-I/Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/darwin-2level/CORE" -Wall -Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES__ IO.c 
IO.xs:210:10: error: invalid argument type 'void' to unary expression 
    if (!SvUPGRADE(buf, SVt_PV)) 
     ^~~~~~~~~~~~~~~~~~~~~~~ 
1 error generated. 
make[1]: *** [IO.o] Error 1 
make: *** [subdirs] Error 2 

正如你所看到的,我也運行perlbrew。

任何想法可能導致這種情況?

回答

0

從5.17.7版本說明:

SvUPGRADE() is no longer an expression. Originally this macro (and its underlying function, sv_upgrade()) were documented as boolean, although in reality they always croaked on error and never returned false. In 2005 the documentation was updated to specify a void return value, but SvUPGRADE() was left always returning 1 for backwards compatibility. This has now been removed, and SvUPGRADE() is now a statement with no return value.

So this is now a syntax error:

if (!SvUPGRADE(sv)) { croak(...); } 

If you have code like that, simply replace it with

SvUPGRADE(sv); 

or to to avoid compiler warnings with older perls, possibly

(void)SvUPGRADE(sv); 

它已經被reported

相關問題