[mrtg] Re: linux rateup

Yozo Toda yozo at aohakobe.ipc.chiba-u.ac.jp
Tue Aug 31 17:42:39 MEST 1999

> This is the error that now shows up when running ./mrtg mrtg.cfg
> .//rateup: error in loading shared libraries: libgd.so.0: cannot open shared
> object file: No such file or directory

your dynamic linker cannot find libgd.so.0. why?
I have no linux system in handy, but I suppose
you can use ldd command to check which libraries rateup depends.
(and I bet you see "libgd: not found"...)

read the man page of ld and ldd.
I suppose you can find a clue for dynamic library (shared objects) management.

on solaris system, I do such like

  setenv LD_LIBRARY_PATH /usr/local/lib:/opt/gd/lib:/some/other/dir
to notice the dynamic linker which directories to look for the library.
check which environment variable you should setup.

> I've tried these two solutions and they have not helped.
> >solution 2: after configure'd and before make'ing,
>             edit Makefile and add -R option to LDFLAG
>             to specify the directory gd library resides.
>             for example, change the line
>                 LDFLAGS =  -lm -L/opt/gd/lib -lgd -lpng -lz
>             to
>                 LDFLAGS =  -lm -L/opt/gd/lib -R/opt/gd/lib -lgd -lpng -lz
>             which effects ld.so to search that directory.
> >solution 3: after configure'd and before make'ing,
>             edit Makefile and add an option to LDFLAG
>             to force ld to link the static library libgd.a.
>             for example, option "-B static" is needed for Solaris
> /usr/ccs/ld.
>             with GNU egcs compiler I can use -Xlinker option;
>      LDFLAGS =  -lm -Xlinker -B -Xlinker static -L/opt/gd/lib -lgd -lpng -lz
> My libgd.so is located in /usr/local/lib

solution3 is in effect only when you have libgd.a (for static linking).

-- 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