When I tried to compile (with the default C compiler) Nagios-1.2 on my 5.1B box, I got
the following error:
nagios.c:
cc: Error: nagios.c, line 303: In the initializer for long_options, an array's element type is incomplete, which precludes its initialization. (incompelinit)
{"help",no_argument,0,'h'},
----------------^
../xdata/xrddefault.c:
../common/comments.c:
../xdata/xcddefault.c:
../common/objects.c:
../xdata/xodtemplate.c:
cc: Warning: ../xdata/xodtemplate.c, line 5836: In this statement, this argument to snprintf is of "int" type and is not appropriate for the conversion specifier "%s". The value will be formatted in an unintended manner. (outstringtype)
snprintf(temp_buffer,sizeof(temp_buffer)-1,"Error: Could not add contactgroup '%s' to hostgroup escalation (config file '%s', line %d)\n",xodtemplate_config_file_name(this_hostgroupescalation->_config_file),this_hostgroupescalation->_start_line);
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
cc: Warning: ../xdata/xodtemplate.c, line 5836: In this statement, the number of conversion specifiers to snprintf exceeds the number of values to be converted. Conversion specifiers from "%d" onward will process meaningless and perhaps invalid data. (outtoofew)
snprintf(temp_buffer,sizeof(temp_buffer)-1,"Error: Could not add contactgroup '%s' to hostgroup escalation (config file '%s', line %d)\n",xodtemplate_config_file_name(this_hostgroupescalation->_config_file),this_hostgroupescalation->_start_line);
-------------------------------------------------------------------^
cc: Warning: ../xdata/xodtemplate.c, line 2798: The scalar variable "host_name" is fetched but not initialized. And there may be other such fetches of this variable that have not been reported in this compilation. (uninit1)
free(host_name);
-------------------------------------^
../common/statusdata.c:
../xdata/xsddefault.c:
../xdata/xpddefault.c:
../common/downtime.c:
cc: Warning: ../common/downtime.c, line 673: The scalar variable "result" is fetched but not initialized. And there may be other such fetches of this variable that have not been reported in this compilation. (uninit1)
return result;
---------------^
../xdata/xdddefault.c:
*** Exit 1
Stop.
*** Exit 1
Stop.
$
Here is how I configured it:
export PATH=$PATH:/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/ucb:/usr/bin/X11
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-grp=nagios
Does anyone know what's wrong here?
Thanks,
Zoong
Received on Fri Nov 26 2004 - 05:28:24 NZDT