[mrtg] Re: MRTG 2.8.6 & gd 1.3

Yozo Toda yozo at aohakobe.ipc.chiba-u.ac.jp
Sun Aug 22 12:00:15 MEST 1999


> src/rateup.c:58: gd.h: No such file or directory     
> src/rateup.c:59: gdfonts.h: No such file or directory
> 
> I have placed these files in the src directory (configure seemed to be able
> to find gd just fine with the --with-gd parameter). What am I doing wrong?

I'm not sure what's wrong, but the compiler complains
it cannot find the include files gd.h and gdfonts.h.

check Makefile.  I bet CFLAGS is not defined appropriately.
relevant part here from my environment:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CC = gcc
CFLAGS = -g -O2 -I/opt/gd/include -DGFORM_GD=gdImagePng -Wall -pedantic
## LDFLAGS =  -lm -L/opt/gd/lib -lgd -lpng -lz
LDFLAGS =  -lm -L/opt/gd/lib -R/opt/gd/lib -lgd -lpng -R/usr/local/lib -lz
GDFORM_EXT = png

all:	 run/rateup subst

run/rateup: src/rateup.c
	$(CC) $(CFLAGS) src/rateup.c $(LDFLAGS) -o run/rateup

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

make variable CFLAGS should specify the directory to search gd include files
("-I/opt/gd/include" above).
edit this Makefile directly, and do make again.

I added -R/usr/local/lib to LDFLAGS to embed in the rateup binary
the path where to find libz.so and libgd.so on runtime.
with this I don't need to set environment variable LD_LIBRARY_PATH
when running rateup.
(png library libpng.a is not a shared object, so,
necessary routines from libpng.a are linked to rateup binary compiletime.
hence "-R" is not necesary.)

-- yozo.

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list