Compilation problem of Nagios with MySQL on SOLARIS 8
HELION Jean-Luc
jean-luc.helion at c-s.fr
Tue Jun 22 08:20:43 CEST 2004
I am getting errors when I "make all" after configuring Nagios (1.1) with mysql support (4.0).
When I "configure" :
./configure --prefix=/logiciels/nagios/ --with-gd-lib=/usr/local/lib --with-gd-inc=/usr/local/include --with-mysql-status --with-mysql-lib=/usr/lib/mysql --with-mysql-inc=/usr/include/mysql
Everything is ok :
...
We'll use MySQL database routines (in xdata/xsddb.*) for status data I/O...
We'll use default routines (in xdata/xcddefault.*) for comment data I/O...
We'll use template-based routines (in xdata/xedtemplate.*) for extended data I/O...
We'll use default routines (in xdata/xrddefault.*) for retention data I/O...
We'll use template-based routines (in xdata/xodtemplate.*) for object data I/O...
We'll use default routines (in xdata/xpddefault.*) for performance data I/O...
We'll use default routines (in xdata/xdddefault.*) for scheduled downtime data I/O...
checking for main in -lmysqlclient... yes
MySQL library was found!
....
But when I "make all". I get the following errors:
Undefined first referenced
symbol in file
mysql_init /var/tmp//cc8QZRJY.o
mysql_errno /var/tmp//cc8QZRJY.o
mysql_close /var/tmp//cc8QZRJY.o
mysql_query /var/tmp//cc8QZRJY.o
mysql_real_connect /var/tmp//cc8QZRJY.o
ld: fatal: Symbol referencing errors. No output written to nagios
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `nagios'
Current working directory /logiciels/nagios/sources/nagios-1.1/base
*** Error code 1
make: Fatal error: Command failed for target `all'
I have seen references to these errors on this mailing list and the fix was to put the LDFLAGS statements:
-L/usr/lib/mysql/lib -lmysqlclient -lz
at the end of the compile statement after the file names like so:
gcc -g -O2 -I/usr/include/mysql/include -DHAVE_CONFIG_H -DNSCGI avail.c getcgi.o cgiutils.o auth.o popen.o ../common/objects.c ../xdata/xodtemplate.c ../common/statusdata.c ../xdata/xsddb.c -o avail.cgi -L/usr/lib/mysql/lib -lmysqlclient -lz
A user discovered this related to Nagios being unable to find the MySQL libaries
(http://www.mysql.com/doc/en/Link_errors.html).
Anybody knows how to change the makefile to move the LDFLAGS stuff to the end of the compilation statement or How to compile manually each program ? Or something else to solve my problem?
I become crazy...Please, help me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20040622/3478f12e/attachment.html>
More information about the Users
mailing list