Gd problems ....

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Fri May 21 06:19:00 CEST 2004


On Thu, May 20, 2004 at 08:12:32PM -0700, nagios-users-request at lists.sourceforge.net wrote:

  .. several megabytes of multi-part snipped ...

> 
> Message: 10
> Date: Fri, 21 May 2004 12:26:26 +0930
> From: "Justin Hennessy" <jhennessy at mitchamcouncil.sa.gov.au>
> Subject: RE: [Nagios-users] Statusmap
> 
> I am still having the same issue. I have read EVERY post in the
> archieve and I have also done the make devclean, make distclean, make
> clean etc.
> 

  .. snip 

> > I am running Nagios 1.2 on a Red Hat 9,  2.4 kernel (fairly new
> one).
> > 
> > This is the error from the configure script:
> >
> -----------------------------------------------------------------------------------------------------------------------------------------
> > checking for main in -liconv... (cached) no
> > checking for gdImagePng in -lgd (order 1)... (cached) no
> > checking for gdImagePng in -lgd (order 2)... (cached) no
> > checking for gdImagePng in -lgd (order 3)... (cached) no
> > 
> > 

configure is a shell script that builds a Makefile for make to compile 
and link Nagios. It does this by compiling programs like

tsitc> cat x.c
char gdImagePng();

int main() {
gdImagePng()
; return 0; }

(which you can find in configure by searching for gd) with the options 
from the same place

LIBS="-lgd $ICONV -lz -lm -lpng -ljpeg $LIBS"

assuming these libs are in the standard places for your system eg

tsitc> gcc -o x x.c -lz -lm -lpng -lgd 
/usr/libexec/elf/ld: cannot find -lpng

 .. so it needs to be told where libpng is found. Configure tries to 
suss this out using what you have told it and what it knows about 
common distros.

tsitc> gcc -o x x.c -lz -lm -lpng -lgd -L /usr/local/lib


so that it can supply the Makefile with values for the -I and -l -L
options;  these last - library names and paths (if in non-standard
paths) are what your compilation lacks (apart from the math lib -lm).


> > cd ./base && make
> > make[1]: Entering directory `/root/nagios-1.2/base'
> > gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE  nagios.c checks.o config.o
> > commands.o flapping.o logging.o notifications.o sehandlers.o utils.o
> > sretention.o ../xdata/xrddefault.c ../common/comments.c
> > ../xdata/xcddefault.c ../common/objects.c ../xdata/xodtemplate.c
> > ../common/statusdata.c ../xdata/xsddefault.c perfdata.o
> > ../xdata/xpddefault.c ../common/downtime.c ../xdata/xdddefault.c   
> -lm
> > -o nagios

Here's what a good one looks like

tsitc> make
gcc -g -O2 -I/usr/local/include/gd    
-I/usr/libdata/perl/5.00503/mach/CORE  -DHAVE_CONFIG_H -DNSCORE 
`glib-config --cflags` -L/usr/local/lib  `glib-config --libs` nagios.c 
checks.o config.o commands.o flapping.o logging.o notifications.o 
sehandlers.o utils.o sretention.o ../xdata/xrddefault.c 
../common/comments.c ../xdata/xcddefault.c ../common/objects.c 
../xdata/xodtemplate.c ../common/statusdata.c ../xdata/xsddefault.c 
perfdata.o ../xdata/xpddefault.c ../common/downtime.c 
../xdata/xdddefault.c   -Wl,-R/usr/lib -Wl,-E -lperl -lm  
/usr/libdata/perl/5.00503/mach/auto/DynaLoader/DynaLoader.a 
-L/usr/libdata/perl/5.00503/mach/CORE -lperl -lm -lc -lcrypt -lperl -lm 
-lm -o nagios

(this is for a glib chained hash patch  embedded Perl so there is more 
junk than you need).


You need to 

1 Find the path of the gd library. It is called libgd.*
  Find the path of the gh headers. It is called gd.h.

Common places are I believe /usr/lib and /usr/local/lib for the 
libraries; /usr/include and /usr/local/include for the headers.

2 Check if the missing symbol is in libgd 

pc09011> nm /usr/local/lib/libgd.a | grep gdImagePng
         U gdImagePngCtx
00000000 T gdImagePngToSink
0000082c T gdImagePng
000008b0 T gdImagePngCtx
00000864 T gdImagePngPtr

pc09011> nm /usr/local/lib/libgd.so | grep gdImagePng
00009c4c T gdImagePng
00009ce8 T gdImagePngCtx
00009c90 T gdImagePngPtr
00009138 T gdImagePngToSink
pc09011> 

3 If yes ? ==> 4 : your library is toast. Ask again, quoting the nm 
result

4 make clean (ensure that config.cache is gone)

5 ./configure --other-nag-switches --with-gd-lib=PATH-containing-lib-gd 
--with-gd-inc=PATH-containing-gd.h

Same message about not finding libgd ? Ask again quoting result :  ==> 6

6 make all

Finally you can always do what I have shown you here: try and build the 
test program yourself. If you can't build it by hand, configure won't be 
clever enough.

Yours sincerely.

-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list