无法通过cpan/cpanm强制安装GD [英] Cannot force install GD with cpan/cpanm

查看:404
本文介绍了无法通过cpan/cpanm强制安装GD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经查看并看到了类似的问题,但是无法使GD运行. 安装了libgd和libpng时会出现以下错误 ...

I have looked and seen similar issues posted but am unable to get GD working. the following error arises with libgd and libpng installed...

clang -c  -I/usr/local/include -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Wformat=0 -Os   -DVERSION=\"2.50\" -DXS_VERSION=\"2.50\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"  -DHAVE_FT -DHAVE_GIF -DHAVE_ANIMGIF -DVERSION_33 -DHAVE_UNCLOSEDPOLY -DHAVE_FTCIRCLE GD.c
GD.xs:997:18: warning: implicit declaration of function 'gdImageGifAnimBeginPtr' is invalid in C99 [-Wimplicit-function-declaration]
        data = (void *) gdImageGifAnimBeginPtr(image,&size,globalcm,loops);
                        ^
GD.xs:1022:18: warning: implicit declaration of function 'gdImageGifAnimAddPtr' is invalid in C99 [-Wimplicit-function-declaration]
        data = (void *) gdImageGifAnimAddPtr(image,&size,localcm,leftofs,topofs,delay,disposal,previm);
                        ^
GD.xs:1041:18: warning: implicit declaration of function 'gdImageGifAnimEndPtr' is invalid in C99 [-Wimplicit-function-declaration]
        data = (void *) gdImageGifAnimEndPtr(&size);
                        ^
GD.xs:1598:3: warning: implicit declaration of function 'gdImageOpenPolygon' is invalid in C99 [-Wimplicit-function-declaration]
                gdImageOpenPolygon(image,polyptr,length,color);
                ^
GD.xs:2192:16: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
            if (value = hv_fetch(hash,"linespacing",strlen("linespacing"),0)) {
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GD.xs:2192:16: note: place parentheses around the assignment to silence this warning
            if (value = hv_fetch(hash,"linespacing",strlen("linespacing"),0)) {
                      ^
                (                                                           )

...

2 warnings generated.
rm -f blib/arch/auto/GD/GD.bundle
LD_RUN_PATH="/usr/lib:/usr/local/lib" clang -mmacosx-version-min=10.8  -arch i386 -arch x86_64 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector GD.o  -o blib/arch/auto/GD/GD.bundle    \
       -L/usr/local/lib -lz -liconv -lgd    \

ld: warning: ignoring file /usr/local/lib/libgd.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libgd.dylib
chmod 755 blib/arch/auto/GD/GD.bundle
/usr/bin/perl -MExtUtils::Command::MM -e 'cp_nonempty' -- GD.bs blib/arch/auto/GD/GD.bs 644
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" bdf_scripts/bdf2gdfont.PLS bdf_scripts/bdf2gdfont.pl
Extracting bdf2gdfont.pl (with variable substitutions)
cp bdf_scripts/bdf2gdfont.pl blib/script/bdf2gdfont.pl
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/bdf2gdfont.pl
Manifying blib/man1/bdf2gdfont.pl.1
Manifying blib/man3/GD.3pm
Manifying blib/man3/GD::Image.3pm
Manifying blib/man3/GD::Polygon.3pm
Manifying blib/man3/GD::Polyline.3pm
Manifying blib/man3/GD::Simple.3pm
Running Mkbootstrap for GD ()
chmod 644 GD.bs
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Testing using gif support.
t/GD.t ........ 
Failed 6/12 subtests 
    (less 3 skipped subtests: 3 okay)
t/Polyline.t .. ok

Test Summary Report
-------------------
t/GD.t      (Wstat: 0 Tests: 12 Failed: 6)
  Failed tests:  2-7
Files=2, Tests=13,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.10 cusr  0.01 csys =  0.14 CPU)
Result: FAIL
Failed 1/2 test programs. 6/13 subtests failed.
make: *** [test_dynamic] Error 255
-> FAIL Installing GD failed. See /Users/lraven/.cpanm/work/1391048234.74068/build.log for details. Retry with --force to force install it.
Expiring 19 work directories.

我需要安装的所有其他模块,而不仅仅是GD.

All other modules I need are installing, just not GD.

我正在使用OS X 10.8.5,bash版本3.2.48,perl版本5.012和cpanm版本1.7

I am using OS X 10.8.5, bash version 3.2.48, perl version 5.012 and cpanm version 1.7

推荐答案

在安装GD Perl模块之前,必须先安装许多其他库,包括gd图形库本身(

Before you can install GD the Perl module you must have installed a number of other libraries first, including the gd graphics library itself (libgd), the PNG library (libpng) and optionally the JPEG and FreeType libraries.

您可能会发现使用 MacPorts 来安装这些库更加容易,然后可以从那里-该软件包也称为p5.14-gd(或与您的perl版本匹配的任何软件包)

You will probably find it easier to use MacPorts to install these libraries, and you can then install GD from there too - the package is called p5.14-gd (or whatever matches your perl version)

这篇关于无法通过cpan/cpanm强制安装GD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆