compused has asked for the wisdom of the Perl Monks concerning the following question:

'make' failed using cpan to install the GD module in perl 5.14.2, installed on a QNAP NAS device. It just said it 'had problems' and 'won't make', 'won't test' etc
So I tried a direct perl compile of the module but got the warning listed in the title of this post during configuration using 'perl Makefile.PL' and 'make' did absolutely nothing! See below for the full output


Googling 'found gd.h header file in /usr/includegd.h' yields many posts but no obvious solution!
gd-2.0.28 has been installed

Prior to pasting what happened, please note this:

find /* -name 'gd.h'
shows:
/share/MD0_DATA/misc/gd-2.0.28/<b>gd.h</b> /share/MD0_DATA/.qpkg/Optware/include/gd.h

in case it appears below, /opt is a shortcut to /share/MD0_DATA/.qpkg/Optware

So here we go:

cd /share/MD0_DATA/.cpan/build_dir/GD-2.46-hg6AiN [/share/MD0_DATA/.cpan/build_dir/GD-2.46-hg6AiN] # perl Makefile.PL Notice: Type perl Makefile.PL -h for command-line option summary. Configuring for libgd version 2.0.28. Checking for stray libgd header files... ** WARNING: found gd.h header file in /usr/includegd.h, but it is expe +cted at /opt/include/gd.h. This may cause compile errors! ** ** WARNING: found gd.h header file in /usr/includegd.h, but it is expe +cted at /opt/include/gd.h. This may cause compile errors! ** ** Possible problems found ** Included Features: GD_JPEG GD_FREETYPE GD_PNG GD_GIF GD library used from: /opt Checking if your kit is complete... Looks good Writing Makefile for GD Writing MYMETA.yml [/share/MD0_DATA/.cpan/build_dir/GD-2.46-hg6AiN] # make /share/MD0_DATA/.qpkg/Optware/bin/perl GD/Image.pm.PLS GD/Image.pm Extracting Image.pm (with variable substitutions) cp GD/Polyline.pm blib/lib/GD/Polyline.pm cp qd.pl blib/lib/qd.pl cp GD/Image.pm blib/lib/GD/Image.pm cp GD.pm blib/lib/GD.pm AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD) cp GD/Simple.pm blib/lib/GD/Simple.pm cp GD/Polygon.pm blib/lib/GD/Polygon.pm cp GD/Group.pm blib/lib/GD/Group.pm /share/MD0_DATA/.qpkg/Optware/bin/perl /opt/lib/perl5/5.14.2/ExtUtils/ +xsubpp -typemap /opt/lib/perl5/5.14.2/ExtUtils/typemap -typemap type +map GD.xs > GD.xsc && mv GD.xsc GD.c gcc -c -I/opt/include -Wformat=0 -g -DVERSION=\"2.46\" -DXS_VERSION +=\"2.46\" -fPIC "-I/opt/lib/perl5/5.14.2/armv5tel-linux-thread-multi/ +CORE" -DHAVE_JPEG -DHAVE_FT -DHAVE_GIF -DHAVE_PNG GD.c Running Mkbootstrap for GD () chmod 644 GD.bs rm -f blib/arch/auto/GD/GD.so LD_RUN_PATH="/opt/lib" gcc -shared -g -L/usr/local/lib -fstack-protec +tor GD.o -o blib/arch/auto/GD/GD.so \ -L/opt/lib -L/opt/lib -L/opt/lib -ljpeg -lfreetype -lpng -lz -lm -l +gd \ chmod 755 blib/arch/auto/GD/GD.so cp GD.bs blib/arch/auto/GD/GD.bs chmod 644 blib/arch/auto/GD/GD.bs /share/MD0_DATA/.qpkg/Optware/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 /share/MD0_DATA/.qpkg/Optware/bin/perl -MExtUtils::MY -e 'MY->fixin(sh +ift)' -- blib/script/bdf2gdfont.pl <e/config --with-freetype=/opt/include/freetype2/freetype --with-png=/ +opt/include/libpng15 --prefix=/opt

Also, here is 'make test':

make test PERL_DL_NONLAZY=1 /share/MD0_DATA/.qpkg/Optware/bin/perl "-MExtUtils:: +Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/GD.t ........ Can't load './blib/arch/auto/GD/GD.so' for module GD: +/opt/lib/libgd.so.2: undefined symbol: jpeg_resync_to_restart at /opt +/lib/perl5/5.14.2/armv5tel-linux-thread-multi/DynaLoader.pm line 190. at t/GD.t line 14 Compilation failed in require at t/GD.t line 14. BEGIN failed--compilation aborted at t/GD.t line 14. t/GD.t ........ Dubious, test returned 2 (wstat 512, 0x200) Failed 12/12 subtests t/Polyline.t .. Can't load '/share/MD0_DATA/.cpan/build_dir/GD-2.46-hg +6AiN/blib/arch/auto/GD/GD.so' for module GD: /opt/lib/libgd.so.2: und +efined symbol: jpeg_resync_to_restart at /opt/lib/perl5/5.14.2/armv5t +el-linux-thread-multi/DynaLoader.pm line 190. at /share/MD0_DATA/.cpan/build_dir/GD-2.46-hg6AiN/blib/lib/GD/Polylin +e.pm line 45 Compilation failed in require at /share/MD0_DATA/.cpan/build_dir/GD-2. +46-hg6AiN/blib/lib/GD/Polyline.pm line 45. BEGIN failed--compilation aborted at /share/MD0_DATA/.cpan/build_dir/G +D-2.46-hg6AiN/blib/lib/GD/Polyline.pm line 45. Compilation failed in require at t/Polyline.t line 10. BEGIN failed--compilation aborted at t/Polyline.t line 10. t/Polyline.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 1/1 subtests Test Summary Report ------------------- t/GD.t (Wstat: 512 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 2 Parse errors: Bad plan. You planned 12 tests but ran 1. t/Polyline.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 1 tests but ran 0. Files=2, Tests=1, 1 wallclock secs ( 0.22 usr 0.03 sys + 0.59 cusr + 0.05 csys = 0.89 CPU) Result: FAIL Failed 2/2 test programs. 1/1 subtests failed. make: *** [test_dynamic] Error 2

What is the problem here?

Replies are listed 'Best First'.
Re: found gd.h header file in /usr/includegd.h
by syphilis (Archbishop) on Feb 29, 2012 at 01:00 UTC
    undefined symbol: jpeg_resync_to_restart

    That's your problem - the symbol should be defined in the libjpeg shared object.
    Perhaps you merely need to upgrade your jpeg installation.

    Cheers,
    Rob

      thanks...I installed an upgraded libgd via ipkg (a packet management system) and that particular error has gone. There are NO errors or clues during 'make'. But 'make test' still fails

      in particular, the found gd.h header file in /usr/includegd.h !!warning!! persists

      [/share/MD0_DATA/.cpan/build_dir/GD-2.46-hg6AiN] perl Makefile.PL Notice: Type perl Makefile.PL -h for command-line option summary. Configuring for libgd version 2.0.35. Checking for stray libgd header files... ** WARNING: found gd.h header file in /usr/includegd.h, but it is expe +cted at /opt/include/gd.h. This may cause compile errors! ** ** WARNING: found gd.h header file in /usr/includegd.h, but it is expe +cted at /opt/include/gd.h. This may cause compile errors! ** ** Possible problems found ** Included Features: GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG G +D_GIF GD_GIFANIM GD_OPENPOLYGON GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33 GD library used from: /opt Checking if your kit is complete... Looks good Writing Makefile for GD Writing MYMETA.yml

      Then:

      [/share/MD0_DATA/.cpan/build_dir/GD-2.46-hg6AiN] # make /share/MD0_DATA/.qpkg/Optware/bin/perl GD/Image.pm.PLS GD/Image.pm Extracting Image.pm (with variable substitutions) cp GD/Polyline.pm blib/lib/GD/Polyline.pm cp qd.pl blib/lib/qd.pl cp GD/Image.pm blib/lib/GD/Image.pm cp GD.pm blib/lib/GD.pm AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD) cp GD/Simple.pm blib/lib/GD/Simple.pm cp GD/Polygon.pm blib/lib/GD/Polygon.pm cp GD/Group.pm blib/lib/GD/Group.pm /share/MD0_DATA/.qpkg/Optware/bin/perl /opt/lib/perl5/5.14.2/ExtUtils/ +xsubpp -typemap /opt/lib/perl5/5.14.2/ExtUtils/typemap -typemap typemap GD.xs > GD.xsc && mv GD.xsc GD.c gcc -c -I/opt/include -Wformat=0 -g -DVERSION=\"2.46\" -DXS_VERSION +=\"2.46\" -fPIC "-I/opt/lib/perl5/5.14.2/armv5tel-linux-thread-multi/CORE" -DHAVE_JPE +G -DHAVE_FT -DHAVE_GIF -DHAVE_PNG -DHAVE_ANIMGIF -DVERSION_33 -DHAVE_UNCLOSEDPOLY -DHAVE_FONTCONFIG -DHAVE_FTCIRCLE GD. +c Running Mkbootstrap for GD () chmod 644 GD.bs rm -f blib/arch/auto/GD/GD.so LD_RUN_PATH="/opt/lib" gcc -shared -g -L/usr/local/lib -fstack-protec +tor GD.o -o blib/arch/auto/GD/GD.so \ -L/opt/lib -L/opt/lib -L/opt/lib -ljpeg -lfontconfig -lfreetype -lp +ng12 -lz -lm -lgd \ chmod 755 blib/arch/auto/GD/GD.so cp GD.bs blib/arch/auto/GD/GD.bs chmod 644 blib/arch/auto/GD/GD.bs /share/MD0_DATA/.qpkg/Optware/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 /share/MD0_DATA/.qpkg/Optware/bin/perl -MExtUtils::MY -e 'MY->fixin(sh +ift)' -- blib/script/bdf2gdfont.pl

      then 'make test' fails:

      [/share/MD0_DATA/.cpan/build_dir/GD-2.46-hg6AiN] # make test PERL_DL_NONLAZY=1 /share/MD0_DATA/.qpkg/Optware/bin/perl "-MExtUtils:: +Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/GD.t ........ Testing using png support. t/GD.t ........ Failed 11/12 subtests t/Polyline.t .. ok Test Summary Report ------------------- t/GD.t (Wstat: 11 Tests: 1 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 12 tests but ran 1. Files=2, Tests=2, 2 wallclock secs ( 0.24 usr 0.01 sys + 1.00 cusr + 0.08 csys = 1.33 CPU) Result: FAIL Failed 1/2 test programs. 0/2 subtests failed. make: *** [test_dynamic] Error 255

      any help please?

Re: found gd.h header file in /usr/includegd.h
by Anonymous Monk on Feb 28, 2012 at 22:53 UTC

    What is the problem here?

    The stuff you copy/pasted shows no error messages. This usually means there is no problem. Can't help you without an error message.