compilation error for 2.0-very-pre-alpha 08-18-2003

Steve OBrien sobrien at ci.bend.or.us
Thu Sep 11 19:09:24 CEST 2003


Looks like the same issue as I had with 1.1 and mysql.
Whoops, no this is the solution that worked for me not the last.... Sorry. 


Steve O'Brien
City of Bend
Network Administrator
sobrien at ci.bend.or.us
541-322-6393 


tnelson at starpoint.com 
08/21/2003 11:42 AM 


To
Steve OBrien <sobrien at ci.bend.or.us> 
cc

Subject
Re: [Nagios-users] Errors making Nagios with mysql









I got those same errors.. it has to do w/ the way the makefile is written 
(at least on slackware 9.0).. 

find the link lines in the make files.. and add -lmysqlclient -lz jusr 
before -o .. example.. from my base/Makefile 

nagios: nagios.c $(OBJS) nagios.h $(SRC_COMMON)/locations.h 
       $(CC) $(CFLAGS) $(LDFLAGS) nagios.c $(OBJS) $(PERLLIBS) $(MATHLIBS) 
-lmysqlclient -lz -o $@ 

It seems that the version of ld we have doesn't hang on to the symbols 
unless the libs are at the end.. 

Tony Nelson
Director of IT Operations
Starpoint Solutions
115 Broadway, 2nd Fl.
New York, NY 10006




Steve OBrien <sobrien at ci.bend.or.us> 
Sent by: nagios-users-admin at lists.sourceforge.net 
08/21/2003 10:40 AM 
        
       To:        <nagios-users at lists.sourceforge.net> 
       cc:         
       Subject:        [Nagios-users] Errors making Nagios with mysql





I am getting errors when I make all after configuring Nagios with mysql 
support.  I have seen references to these errors on google and the fix was 
to put LDFLAGS= -L/usr/lib/mysql -lmysqlclient in your Makefile, well mine 
already had it in there.  Anyone else had this problem, I already know 
that DB support is questionable for the future but to me it makes no sense 
to log this data to flat files. 

[root at localhost nagios-1.1]# make all 
cd ./base && make 
make[1]: Entering directory `/home/system/src/nagios-1.1/base' 
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H -DNSCORE -L/usr/lib/mysql 
-lmysqlclient  nagios.c checks.o config.o commands.o flapping.o logging.o 
notifications.o sehandlers.o utils.o sretention.o ../xdata/xrddb.c 
../common/comments.c ../xdata/xcddb.c ../common/objects.c 
../xdata/xodtemplate.c ../common/statusdata.c ../xdata/xsddb.c perfdata.o 
../xdata/xpddefault.c ../common/downtime.c ../xdata/xdddb.c    -lm -o 
nagios 
/tmp/cc1pKEPG.o(.text+0x378): In function `xrddb_initialize': 
../xdata/xrddb.c:215: undefined reference to `mysql_init' 
/tmp/cc1pKEPG.o(.text+0x3f2): In function `xrddb_connect': 
../xdata/xrddb.c:252: undefined reference to `mysql_real_connect' 
/tmp/cc1pKEPG.o(.text+0x40d):../xdata/xrddb.c:254: undefined reference to 
`mysql_close' 
/tmp/cc1pKEPG.o(.text+0x464): In function `xrddb_disconnect': 
../xdata/xrddb.c:299: undefined reference to `mysql_close' 
/tmp/cc1pKEPG.o(.text+0x47c): In function `xrddb_query': 
../xdata/xrddb.c:329: undefined reference to `mysql_query' 
/tmp/cc1pKEPG.o(.text+0xd98): In function 
`xrddb_read_program_information': 
../xdata/xrddb.c:850: undefined reference to `mysql_store_result' 
/tmp/cc1pKEPG.o(.text+0xdb3):../xdata/xrddb.c:854: undefined reference to 
`mysql_fetch_row' 
/tmp/cc1pKEPG.o(.text+0xe79):../xdata/xrddb.c:867: undefined reference to 
`mysql_free_result' 
/tmp/cc1pKEPG.o(.text+0xf38): In function `xrddb_read_host_information': 
../xdata/xrddb.c:951: undefined reference to `mysql_store_result' 
/tmp/cc1pKEPG.o(.text+0xf62):../xdata/xrddb.c:951: undefined reference to 
`mysql_fetch_row' 
/tmp/cc1pKEPG.o(.text+0x1124):../xdata/xrddb.c:1004: undefined reference 
to `mysql_free_result' 
/tmp/cc1pKEPG.o(.text+0x11b8): In function 
`xrddb_read_service_information': 
../xdata/xrddb.c:1129: undefined reference to `mysql_store_result' 
/tmp/cc1pKEPG.o(.text+0x11e2):../xdata/xrddb.c:1129: undefined reference 
to `mysql_fetch_row' 
/tmp/cc1pKEPG.o(.text+0x1431):../xdata/xrddb.c:1195: undefined reference 
to `mysql_free_result' 
/tmp/ccTEGl8x.o(.text+0x378): In function `xcddb_initialize': 
../xdata/xcddb.c:234: undefined reference to `mysql_init' 
/tmp/ccTEGl8x.o(.text+0x3ea): In function `xcddb_connect': 
../xdata/xcddb.c:259: undefined reference to `mysql_real_connect' 
/tmp/ccTEGl8x.o(.text+0x405):../xdata/xcddb.c:261: undefined reference to 
`mysql_close' 
/tmp/ccTEGl8x.o(.text+0x45c): In function `xcddb_disconnect': 
../xdata/xcddb.c:303: undefined reference to `mysql_close' 
/tmp/ccTEGl8x.o(.text+0x474): In function `xcddb_query': 
../xdata/xcddb.c:329: undefined reference to `mysql_query' 
/tmp/ccTEGl8x.o(.text+0x5c3): In function `xcddb_validate_host_comments': 
../xdata/xcddb.c:477: undefined reference to `mysql_store_result' 
/tmp/ccTEGl8x.o(.text+0x5dd):../xdata/xcddb.c:477: undefined reference to 
`mysql_fetch_row' 
/tmp/ccTEGl8x.o(.text+0x673): In function 
`xcddb_validate_service_comments': 
../xdata/xcddb.c:566: undefined reference to `mysql_store_result' 
/tmp/ccTEGl8x.o(.text+0x68d):../xdata/xcddb.c:566: undefined reference to 
`mysql_fetch_row' 
/tmp/ccTEGl8x.o(.text+0x806): In function `xcddb_save_host_comment': 
../xdata/xcddb.c:748: undefined reference to `mysql_insert_id' 
/tmp/ccTEGl8x.o(.text+0x9da): In function `xcddb_save_service_comment': 
../xdata/xcddb.c:847: undefined reference to `mysql_insert_id' 
/tmp/cciRZnh0.o(.text+0x3e4): In function `xsddb_initialize': 
../xdata/xsddb.c:253: undefined reference to `mysql_init' 
/tmp/cciRZnh0.o(.text+0x45e): In function `xsddb_connect': 
../xdata/xsddb.c:286: undefined reference to `mysql_real_connect' 
/tmp/cciRZnh0.o(.text+0x479):../xdata/xsddb.c:288: undefined reference to 
`mysql_close' 
/tmp/cciRZnh0.o(.text+0x4e0): In function `xsddb_disconnect': 
../xdata/xsddb.c:335: undefined reference to `mysql_close' 
/tmp/cciRZnh0.o(.text+0x4f8): In function `xsddb_check_connection': 
../xdata/xsddb.c:363: undefined reference to `mysql_errno' 
/tmp/cciRZnh0.o(.text+0x571):../xdata/xsddb.c:369: undefined reference to 
`mysql_close' 
/tmp/cciRZnh0.o(.text+0x670): In function `xsddb_query': 
../xdata/xsddb.c:463: undefined reference to `mysql_query' 
/tmp/ccFlpGYl.o(.text+0x378): In function `xdddb_initialize': 
../xdata/xdddb.c:234: undefined reference to `mysql_init' 
/tmp/ccFlpGYl.o(.text+0x3ea): In function `xdddb_connect': 
../xdata/xdddb.c:259: undefined reference to `mysql_real_connect' 
/tmp/ccFlpGYl.o(.text+0x405):../xdata/xdddb.c:261: undefined reference to 
`mysql_close' 
/tmp/ccFlpGYl.o(.text+0x45c): In function `xdddb_disconnect': 
../xdata/xdddb.c:303: undefined reference to `mysql_close' 
/tmp/ccFlpGYl.o(.text+0x474): In function `xdddb_query': 
../xdata/xdddb.c:329: undefined reference to `mysql_query' 
/tmp/ccFlpGYl.o(.text+0x574): In function `xdddb_validate_host_downtime': 
../xdata/xdddb.c:473: undefined reference to `mysql_store_result' 
/tmp/ccFlpGYl.o(.text+0x58d):../xdata/xdddb.c:473: undefined reference to 
`mysql_fetch_row' 
/tmp/ccFlpGYl.o(.text+0x64c): In function 
`xdddb_validate_service_downtime': 
../xdata/xdddb.c:587: undefined reference to `mysql_store_result' 
/tmp/ccFlpGYl.o(.text+0x665):../xdata/xdddb.c:587: undefined reference to 
`mysql_fetch_row' 
/tmp/ccFlpGYl.o(.text+0x80a): In function `xdddb_save_host_downtime': 
../xdata/xdddb.c:788: undefined reference to `mysql_insert_id' 
/tmp/ccFlpGYl.o(.text+0x9e6): In function `xdddb_save_service_downtime': 
../xdata/xdddb.c:887: undefined reference to `mysql_insert_id' 
/tmp/ccFlpGYl.o(.text+0xc1d): In function `xdddb_read_host_downtime': 
../xdata/xdddb.c:1107: undefined reference to `mysql_store_result' 
/tmp/ccFlpGYl.o(.text+0xc41):../xdata/xdddb.c:1107: undefined reference to 
`mysql_fetch_row' 
/tmp/ccFlpGYl.o(.text+0xd23):../xdata/xdddb.c:1116: undefined reference to 
`mysql_free_result' 
/tmp/ccFlpGYl.o(.text+0xd40):../xdata/xdddb.c:1149: undefined reference to 
`mysql_free_result' 
/tmp/ccFlpGYl.o(.text+0xd95): In function `xdddb_read_service_downtime': 
../xdata/xdddb.c:1238: undefined reference to `mysql_store_result' 
/tmp/ccFlpGYl.o(.text+0xdb9):../xdata/xdddb.c:1238: undefined reference to 
`mysql_fetch_row' 
/tmp/ccFlpGYl.o(.text+0xe9f):../xdata/xdddb.c:1247: undefined reference to 
`mysql_free_result' 
/tmp/ccFlpGYl.o(.text+0xebc):../xdata/xdddb.c:1280: undefined reference to 
`mysql_free_result' 
collect2: ld returned 1 exit status 
make[1]: *** [nagios] Error 1 
make[1]: Leaving directory `/home/system/src/nagios-1.1/base' 
make: *** [all] Error 2 

Steve O'Brien
City of Bend
Network Administrator
sobrien at ci.bend.or.us
541-322-6393 




"Shapiro, David" <david.shapiro at bti.com> 
Sent by: nagios-users-admin at lists.sourceforge.net
09/11/2003 07:53 AM

To
"'nagios-users at lists.sourceforge.net'" 
<nagios-users at lists.sourceforge.net>
cc

Subject
[Nagios-users] compilation error for 2.0-very-pre-alpha 08-18-2003






Can anybody let me know what I should update/fix to get this compilation 
to work? 
 
Redhat Linux 2.4.2-2
gdchart0.94c 
i686-pc-linux-gnu
rrdtool-1.1.0 
gd-1.8.3 
gdbm-1.8.0
gcc 3.0.4
 
I did a make clean first.
 
Buildt with:
 
/configure \
--with-template-objects \
--with-mysql-lib=/usr/lib/mysql \
--with-mysql-inc=/usr/include/mysql \
--with-mysql-xdata \
--enable-embedded-perl \
--with-perlcache \
--with-ping-command=/usr/local/sbin/fping
 
 
 
nagios 2.0-very-pre-alpha 08-18-2003 ***:
 
 General Options:
 -------------------------
        Nagios executable:  nagios
        Nagios user/group:  nagios,nagios
       Command user/group:  nagios,nagios
            Embedded Perl:  yes, with caching
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
                Lock file:  ${prefix}/var/nagios.lock
           Init directory:  /etc/rc.d/init.d
                  Host OS:  linux-gnu
 
 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  /usr/sbin/traceroute
 
 External Data Routines:
 ------------------------
              Status data:  Database (MySQL)
             Comment data:  Database (MySQL)
            Downtime data:  Database (MySQL)
          Peformance data:  Default (external commands)
 

Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.
 
root at netsaint:/usr/local/nagios #make
Please supply a command line argument (i.e. 'make all').  Other targets 
are:
   nagios cgis contrib modules
   clean
   install install-base install-cgis install-html install-config 
install-init install-commandmode fullinstall
root at netsaint:/usr/local/nagios #make all
cd ./base && make
make[1]: Entering directory `/usr/local/nagios/base'
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o broker.o broker.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o nebmods.o nebmods.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o checks.o checks.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o config.o config.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o commands.o commands.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o events.o events.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o flapping.o flapping.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o logging.o logging.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o notifications.o notifications.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o sehandlers.o sehandlers.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE   -c -o utils.o utils.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE -c -o retention-base.o sretention.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE -c -o xretention-base.o ../xdata/xrddefault.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE -c -o comments-base.o ../common/comments.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE -c -o xcomments-base.o ../xdata/xcddb.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE -c -o objects-base.o ../common/objects.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE -c -o xobjects-base.o ../xdata/xodtemplate.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE -c -o statusdata-base.o ../common/statusdata.c
gcc -g -O2 -I/usr/include/mysql  -D_REENTRANT -D_GNU_SOURCE 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm 
-I/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE -c -o xstatusdata-base.o ../xdata/xsddb.c
../xdata/xsddb.c: In function `xsddb_save_status_data':
../xdata/xsddb.c:902: `ERORR' undeclared (first use in this function)
../xdata/xsddb.c:902: (Each undeclared identifier is reported only once
../xdata/xsddb.c:902: for each function it appears in.)
../xdata/xsddb.c: In function `xsddb_save_program_status':
../xdata/xsddb.c:941: `last_update' undeclared (first use in this 
function)
../xdata/xsddb.c: In function `xsddb_save_host_status':
../xdata/xsddb.c:1054: `host_name' undeclared (first use in this function)
../xdata/xsddb.c: In function `xsddb_save_service_status':
../xdata/xsddb.c:1105: `host_name' undeclared (first use in this function)
../xdata/xsddb.c:1107: `description' undeclared (first use in this 
function)
../xdata/xsddb.c:1113: `temp_host' undeclared (first use in this function)
make[1]: *** [xstatusdata-base.o] Error 1
make[1]: Leaving directory `/usr/local/nagios/base'
make: *** [all] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20030911/b9485da2/attachment.html>


More information about the Users mailing list