[Bioperl-l] Problems installing GD

Barry Moore barry.moore at genetics.utah.edu
Fri Nov 5 11:44:43 EST 2004

I'm posting this to bioperl because GD is a dependency, and because I 
know that a lot of folks here use it.  Hope that's not too much of a 

I'm trying to install the perl GD 2.16 library and make is failing.  I 
have tried all of the suggestions in Linclon's README (except I haven't 
reinstalled perl).  This does not appear to be a problem with libgd 
version (I get the same error trying to install GD-1.19 which doens't 
depend on external libraries) or dynamic linking.  The error I get is 
about a syntax error in syntax error in /usr/include/stdlib.h.  I've 
successfully installed GD on other systems - linux and windows - often 
with difficulty and I haven't seen this particular type of error 
before.  I've googled various parts of the error message and searched 
and read perlmonks, comp.lang.perl.modules, the debian list etc.  No 
similar errors out there that I can find.

I'm installing on an Intel box running Debian GNU/Linux 2.4 and Perl 
5.6.1.  I have installed the latest versions of the following C library 

libpng version 1.2.7
libgd version 2.0.33
freetype version 1.3.1

My system doesn't have rpm.  I tried apt-get install GD, but it couldn't 
find GD (I probably need to set up apt-get).  I tried CPAN shell and 
manual installation from source.  The last two attempts give me the same 
error.  I installed all the above dependencies in the order listed 
manually and and they all installed fine with no errors and those that 
had tests past them.  I su to root, move to the GD-2.16 directory and  
run perl Makefile.PL.  I then run make and get the error:

In file included from /usr/lib/perl/5.6.1/CORE/perl.h:493,
                 from GD.xs:5:
/usr/include/stdlib.h:158: syntax error before `long'
make: *** [GD.o] Error 1

I tried installing GD-1.19 just to get something going, but I get the 
same error.

The comlete output from the perl Makefile.PL and make commands are 
listed below.  Any suggestions?  Thanks.



bmoore at westwater:~/GD-2.16$ su root
westwater:/home/bmoore/GD-2.16# perl Makefile.PL
NOTICE: This module requires libgd 2.0.12 or higher.
        it will NOT work with earlier versions.
        See www.cpan.org for versions of GD that are compatible
        with earlier versions of libgd.

        If you are using Math::Trig 1.01 or lower, it has a bug that
        causes a "prerequisite not found" warning to be issued.  You may
        safely ignore this warning.

        Type perl Makefile.PL -h for command-line option summary

Configuring for libgd version 2.0.33.
Included Features:          GD_XPM GD_PNG GD_GIF
GD library used from:       /usr/local

If you experience compile problems, please check the @INC, @LIBPATH and 
arrays defined in Makefile.PL and manually adjust, if necessary.

Checking if your kit is complete...
Looks good
Writing Makefile for GD
westwater:/home/bmoore/GD-2.16# make
cp qd.pl blib/lib/qd.pl
cp GD.pm blib/lib/GD.pm
AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD)
cp GD/Polyline.pm blib/lib/GD/Polyline.pm
/usr/bin/perl /usr/share/perl/5.6.1/ExtUtils/xsubpp  -typemap 
/usr/share/perl/5.6.1/ExtUtils/typemap -typemap typemap  GD.xs > GD.xsc 
&& mv GD.xsc GD.c
cc -c  -I/usr/local/include -DDEBIAN -fno-strict-aliasing 
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   
-DVERSION=\"2.16\" -DXS_VERSION=\"2.16\" -fPIC 
"-I/usr/lib/perl/5.6.1/CORE"  -DHAVE_XPM -DHAVE_GIF GD.c
In file included from /usr/lib/perl/5.6.1/CORE/perl.h:493,
                 from GD.xs:5:
/usr/include/stdlib.h:158: syntax error before `long'
make: *** [GD.o] Error 1

Barry Moore
Dept. of Human Genetics
University of Utah
Salt Lake City, UT

More information about the Bioperl-l mailing list