weixin_57510297 2024-07-23 21:58 采纳率: 0%
浏览 25
已结题

GD模块安装出错,libgd无法正常安装

我用Ubuntu运行代码试图安装GD模块以使用circos

cpan -i GD

但出现以下错误

Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 23 Jul 2024 04:41:01 GMT
Running install for module 'GD'
Checksum for /root/.cpan/sources/authors/id/R/RU/RURBAN/GD-2.83.tar.gz ok
Configuring R/RU/RURBAN/GD-2.83.tar.gz with Makefile.PL
Configuring for libgd version 2.3.2.
/usr/local/lib/pkgconfig/gdlib.pc: Requires.private:

Included Features:          GD_GIF GD_OPENPOLYGON GD_UNCLOSEDPOLY GD_FTCIRCLE VERSION_33 WINDOWS_BMP
GD library used from:       /usr/local/lib
gdlib-config used from the PATH
External LIBS:               -L/usr/local/lib -L/usr/local/lib64 -lgd
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for GD
Writing MYMETA.yml and MYMETA.json
  RURBAN/GD-2.83.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for R/RU/RURBAN/GD-2.83.tar.gz
"/usr/bin/perl" lib/GD/Image_pm.PL lib/GD/Image.pm
Extracting Image.pm (with variable substitutions)
cp lib/GD.pm blib/lib/GD.pm
AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD)
cp lib/GD/Simple.pm blib/lib/GD/Simple.pm
cp lib/GD/Polygon.pm blib/lib/GD/Polygon.pm
cp lib/GD/Polyline.pm blib/lib/GD/Polyline.pm
cp lib/GD/Image.pm blib/lib/GD/Image.pm
cp lib/GD/Group.pm blib/lib/GD/Group.pm
Running Mkbootstrap for GD ()
chmod 644 "GD.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- GD.bs blib/arch/auto/GD/GD.bs 644
"/usr/bin/perl" "/usr/share/perl/5.34/ExtUtils/xsubpp"  -typemap '/usr/share/perl/5.34/ExtUtils/typemap' -typemap '/root/.cpan/build/GD-2.83-21/typemap'  GD.xs > GD.xsc
mv GD.xsc GD.c
x86_64-linux-gnu-gcc -c  -I/usr/local/include -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wformat=1 -O2 -g   -DVERSION=\"2.83\" -DXS_VERSION=\"2.83\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.34/CORE"  -DHAVE_WBMP -DHAVE_FT -DHAVE_GIF -DVERSION_33 -DHAVE_UNCLOSEDPOLY -DHAVE_FTCIRCLE -DHAVE_BMP -DLIBGD_VERSION="2.3.2" GD.c
rm -f blib/arch/auto/GD/GD.so
x86_64-linux-gnu-gcc  -shared -L/usr/local/lib -fstack-protector-strong  GD.o  -o blib/arch/auto/GD/GD.so  \
   -L/usr/local/lib -lgd   \

chmod 755 blib/arch/auto/GD/GD.so
"/usr/bin/perl" "-Iblib/arch" "-Iblib/lib" bdf_scripts/bdf2gdfont_pl.PL 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 1 pod document
Manifying 6 pod documents
  RURBAN/GD-2.83.tar.gz
  /usr/bin/make -- OK
The current configuration of allow_installing_outdated_dists is 'ask/no', but for this option we would need 'CPAN::DistnameInfo' installed. Please install 'CPAN::DistnameInfo' as soon as possible. As long as we are not equipped with 'CPAN::DistnameInfo' this option does not take effect
Running make test for RURBAN/GD-2.83.tar.gz
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- GD.bs blib/arch/auto/GD/GD.bs 644
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
t/autodetect.t ............ ok
t/caller.t ................ ok
t/fork.t .................. ok
t/GD.t .................... 1/15 # Testing gd 2.3.2 using png support.

#   Failed test 'unable to generate comparison image for test 1 with png: Can't locate object method "newFromPng" via package "GD::Image" at (eval 17) line 1.
# '
#   at t/GD.t line 271.
Can't locate object method "newFromPng" via package "GD::Image" at t/GD.t line 82.
# Looks like your test exited with 255 just after 3.
t/GD.t .................... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 13/15 subtests
t/HSV.t ................... ok
t/Polyline.t .............. ok
t/transp.t ................ ok
t/windows_bmp.t ........... ok
t/z_kwalitee.t ............ skipped: No RELEASE_TESTING
t/z_manifest.t ............ skipped: requires a git checkout and a unix for git and diff
t/z_pod-spell-mistakes.t .. skipped: No RELEASE_TESTING
t/z_pod.t ................. skipped: No RELEASE_TESTING

Test Summary Report
-------------------
t/GD.t                  (Wstat: 65280 Tests: 3 Failed: 1)
  Failed test:  3
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 15 tests but ran 3.
Files=12, Tests=55,  1 wallclock secs ( 0.01 usr  0.07 sys +  0.67 cusr  0.12 csys =  0.87 CPU)
Result: FAIL
root@DESKTOP-3M0NMOI:/tmp/lib#
make: *** [Makefile:1137: test_dynamic] Error 255
  RURBAN/GD-2.83.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports RURBAN/GD-2.83.tar.gz

似乎是libgd无法正常安装
以下是安装libgd后


   Support for gd/gd2 images:        yes
   Support for Zlib:                 yes
   Support for PNG library:          yes
   Support for JPEG library:         yes
   Support for WebP library:         no
   Support for HEIF library:         no
   Support for AVIF library:         no
   Support for TIFF library:         no
   Support for Freetype 2.x library: yes
   Support for Fontconfig library:   no
   Support for Xpm library:          no
   Support for liq library:          no
   Support for complex text:         no
   Support for pthreads:             yes

checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating config/Makefile
config.status: creating config/gdlib.pc
config.status: creating src/config.h
config.status: src/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
root@DESKTOP-3M0NMOI:/home/winger/libgd-2.3.2# make && make install
Making all in src
make[1]: Entering directory '/home/winger/libgd-2.3.2/src'
make  all-am
make[2]: Entering directory '/home/winger/libgd-2.3.2/src'
make[2]: Leaving directory '/home/winger/libgd-2.3.2/src'
make[1]: Leaving directory '/home/winger/libgd-2.3.2/src'
Making all in config
make[1]: Entering directory '/home/winger/libgd-2.3.2/config'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/winger/libgd-2.3.2/config'
Making all in tests
make[1]: Entering directory '/home/winger/libgd-2.3.2/tests'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/winger/libgd-2.3.2/tests'
make[1]: Entering directory '/home/winger/libgd-2.3.2'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/winger/libgd-2.3.2'
Making install in src
make[1]: Entering directory '/home/winger/libgd-2.3.2/src'
make[2]: Entering directory '/home/winger/libgd-2.3.2/src'
 /usr/bin/mkdir -p '/tmp/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libgd.la '/tmp/lib'
libtool: install: /usr/bin/install -c .libs/libgd.so.3.0.10 /tmp/lib/libgd.so.3.0.10
libtool: install: (cd /tmp/lib && { ln -s -f libgd.so.3.0.10 libgd.so.3 || { rm -f libgd.so.3 && ln -s libgd.so.3.0.10 libgd.so.3; }; })
libtool: install: (cd /tmp/lib && { ln -s -f libgd.so.3.0.10 libgd.so || { rm -f libgd.so && ln -s libgd.so.3.0.10 libgd.so; }; })
libtool: install: /usr/bin/install -c .libs/libgd.lai /tmp/lib/libgd.la
libtool: install: /usr/bin/install -c .libs/libgd.a /tmp/lib/libgd.a
libtool: install: chmod 644 /tmp/lib/libgd.a
libtool: install: ranlib /tmp/lib/libgd.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /tmp/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /tmp/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /usr/bin/mkdir -p '/tmp/bin'
  /bin/bash ../libtool   --mode=install /usr/bin/install -c gdcmpgif gdtopng pngtogd webpng gdparttopng gd2topng pngtogd2 annotate gd2copypal gd2togif giftogd2 '/tmp/bin'
libtool: install: /usr/bin/install -c .libs/gdcmpgif /tmp/bin/gdcmpgif
libtool: install: /usr/bin/install -c .libs/gdtopng /tmp/bin/gdtopng
libtool: install: /usr/bin/install -c .libs/pngtogd /tmp/bin/pngtogd
libtool: install: /usr/bin/install -c .libs/webpng /tmp/bin/webpng
libtool: install: /usr/bin/install -c .libs/gdparttopng /tmp/bin/gdparttopng
libtool: install: /usr/bin/install -c .libs/gd2topng /tmp/bin/gd2topng
libtool: install: /usr/bin/install -c .libs/pngtogd2 /tmp/bin/pngtogd2
libtool: install: /usr/bin/install -c .libs/annotate /tmp/bin/annotate
libtool: install: /usr/bin/install -c .libs/gd2copypal /tmp/bin/gd2copypal
libtool: install: /usr/bin/install -c .libs/gd2togif /tmp/bin/gd2togif
libtool: install: /usr/bin/install -c .libs/giftogd2 /tmp/bin/giftogd2
 /usr/bin/mkdir -p '/tmp/bin'
 /usr/bin/install -c bdftogd '/tmp/bin'
 /usr/bin/mkdir -p '/tmp/include'
 /usr/bin/install -c -m 644 gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h entities.h gd_color_map.h gd_errors.h gdpp.h '/tmp/include'
make[2]: Leaving directory '/home/winger/libgd-2.3.2/src'
make[1]: Leaving directory '/home/winger/libgd-2.3.2/src'
Making install in config
make[1]: Entering directory '/home/winger/libgd-2.3.2/config'
make[2]: Entering directory '/home/winger/libgd-2.3.2/config'
make[2]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/tmp/lib/pkgconfig'
 /usr/bin/install -c -m 644 gdlib.pc '/tmp/lib/pkgconfig'
make[2]: Leaving directory '/home/winger/libgd-2.3.2/config'
make[1]: Leaving directory '/home/winger/libgd-2.3.2/config'
Making install in tests
make[1]: Entering directory '/home/winger/libgd-2.3.2/tests'
make[2]: Entering directory '/home/winger/libgd-2.3.2/tests'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/winger/libgd-2.3.2/tests'
make[1]: Leaving directory '/home/winger/libgd-2.3.2/tests'
make[1]: Entering directory '/home/winger/libgd-2.3.2'
make[2]: Entering directory '/home/winger/libgd-2.3.2'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/winger/libgd-2.3.2'
make[1]: Leaving directory '/home/winger/libgd-2.3.2'

试了网上的各种方法都无法解决,请问我应该怎么做?

  • 写回答

32条回答 默认 最新

  • 专家-赤兔[在线] 全栈领域优质创作者 2024-07-23 21:58
    关注
    获得0.30元问题酬金

    引自免费微信小程序:皆我百晓生

    根据您提供的错误信息,问题似乎出在GD模块的测试阶段,特别是在使用PNG支持时。错误提示“Can't locate object method "newFromPng" via package "GD::Image"”表明GD模块无法找到用于处理PNG图像的"newFromPng"方法。这可能是由于GD模块与您的系统中的libgd库版本不兼容或者libgd库未正确安装导致的。

    要解决这个问题,您可以尝试以下几个步骤:

    1. 确认libgd库的版本:确保您的系统中安装了正确版本的libgd库,并且它与GD模块兼容。您可以通过运行命令pkg-config --modversion libgd来检查libgd库的版本。
    2. 安装或更新CPAN::DistnameInfo模块:错误信息中提到需要安装CPAN::DistnameInfo模块来启用某些选项。您可以使用以下命令来安装它:cpan CPAN::DistnameInfo
    3. 重新安装GD模块:在尝试安装GD模块之前,您可以尝试卸载已经安装的GD模块(如果有的话),然后重新运行cpan -i GD进行安装。这将确保您安装的是最新版本的GD模块,并且与您的系统环境兼容。
    4. 检查依赖项:确保您的系统中安装了所有必要的依赖项,以便GD模块能够正常工作。这些依赖项可能包括图像处理库等。
    5. 查看详细的测试报告:运行reports RURBAN/GD-2.83.tar.gz命令查看详细的cpan-testers结果报告,这可能会提供更多关于问题的线索和解决方案。

    如果以上步骤仍然无法解决问题,您可以尝试在相关的开发社区或论坛上搜索类似的问题,并查看其他用户是如何解决类似问题的。有时候,问题可能是由于特定的系统配置或环境引起的,通过查看其他用户的解决方案可能会找到适用于您情况的解决方案。

    评论 编辑记录

报告相同问题?

问题事件

  • 系统已结题 7月31日
  • 赞助了问题酬金15元 7月23日
  • 修改了问题 7月23日
  • 创建了问题 7月23日

悬赏问题

  • ¥15 35114 SVAC视频验签的问题
  • ¥15 impedancepy
  • ¥15 在虚拟机环境下完成以下,要求截图!
  • ¥15 求往届大挑得奖作品(ppt…)
  • ¥15 如何在vue.config.js中读取到public文件夹下window.APP_CONFIG.API_BASE_URL的值
  • ¥50 浦育平台scratch图形化编程
  • ¥20 求这个的原理图 只要原理图
  • ¥15 vue2项目中,如何配置环境,可以在打完包之后修改请求的服务器地址
  • ¥20 微信的店铺小程序如何修改背景图
  • ¥15 UE5.1局部变量对蓝图不可见