Since I
succeeded in building Apache 2 on my Mac, I decided it's time to finally install the
GD Perl Module to generate nice images using Perl. I downloaded the source, configured it as usual with
$ perl ./Makefile.PL, ran the test with
$ make test as documented everywhere and got the following errors:
$[pp] ~/Desktop/downloads/GD-2.34: make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/GD..........Can't load './blib/arch/auto/GD/GD.bundle' for module GD: dlopen(./blib/arch/auto/GD/GD.bundle, 2): Symbol not found: _libiconv_close
Referenced from: /opt/local/lib/libgd.2.dylib
Expected in: flat namespace
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..........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-12
Failed 12/12 tests, 0.00% okay
t/Polyline....Can't load '/Users/pp/Desktop/downloads/GD-2.34/blib/arch/auto/GD/GD.bundle' for module GD: dlopen(/Users/pp/Desktop/downloads/GD-2.34/blib/arch/auto/GD/GD.bundle, 2): Symbol not found: _libiconv_close
Referenced from: /opt/local/lib/libgd.2.dylib
Expected in: flat namespace
at /Users/pp/Desktop/downloads/GD-2.34/blib/lib/GD/Polyline.pm line 45
Compilation failed in require at /Users/pp/Desktop/downloads/GD-2.34/blib/lib/GD/Polyline.pm line 45.
BEGIN failed--compilation aborted at /Users/pp/Desktop/downloads/GD-2.34/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....dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/GD.t 255 65280 12 23 191.67% 1-12
t/Polyline.t 255 65280 1 2 200.00% 1
Failed 2/2 test scripts, 0.00% okay. 13/13 subtests failed, 0.00% okay.
make: *** [test_dynamic] Error 2
So, I thought that needs some tweaking. I googled around and found many hints, most described on how to alter the configuration-file
Makefile.pl, but no matter what I tried, always the same error. After some time trying to install other versions of libpng, zlib and stuff - without the slightest success - I decided to simply try a
make && sudo make install, and guess what: build succeeded and no problems so far. So, if you run into the same problems as cited above, just go ahead and install GD.pm, it'll work (at least it did for me...).
Rafael: Thank you very much, I was having a huge headache to solve the very same problem!