Solved: libgd & CGI's on solaris

Jason Martin jhmartin at toger.us
Sat Nov 8 20:51:08 CET 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

After installing all the required graphics libraries on a Solaris 8 
machine from sunfreeware.com, I attempted to configure the nagios CGI's.  
Unfortunately the ./configure script kept saying that GD wasn't installed 
even though I had specified --with-gd-inc and --with-gd-lib correctly.
 
I looked in the config.log and saw this:

configure:2660: checking for gdImagePng in -lgd (order 1)
configure:2679: gcc -o conftest -g -O2   conftest.c -lgd -lz -lm -lpng 
- -ljpeg  1>&5
Undefined           first referenced
 symbol                 in file
libiconv                            /usr/local/lib/libgd.so
libiconv_open                       /usr/local/lib/libgd.so
libiconv_close                      /usr/local/lib/libgd.so
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 2668 "configure"
#include "confdefs.h"
    /* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImagePng();

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

libiconv was already installed in the same dir as libgd. I was able to get 
it working by calling the configure script as thus:
LIBS="-liconv" ./configure

Note that after this I had to enable "PassEnv LD_LIBRARY_PATH" for apache
and make sure that /etc/profile was appending /usr/local/lib to it.  
Otherwise the CGI's gave a 500 error, and the error log said: 
[Sat Nov 8 11:34:09 2003] [error] [client xxx.xxx.xxx.xxx] Premature end
of script headers: /usr/local/nagios/sbin/trends.cgi ld.so.1: status.cgi:
fatal: libiconv.so.2: open failed: No such file or directory

- -Jason Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.3 (GNU/Linux)
Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/

iD8DBQE/rUkyl2ODWuqVSBMRAiPXAJ4yZIBDC+NF1irCy5Nd7RV/1BlRvgCfRuCG
bJZ3F/mM+S7gSvXpQKe92Hw=
=XE+3
-----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
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