I was building Nagios core 3.2.3 ( http://prdownloads.sourceforge.net/sour ... 2.3.tar.gz ) in my Solaris Box ( uname -a: SunOS nagios 5.9 Generic_118558-25 sun4u sparc SUNW,Sun-Fire-V490), but the compilation proccess was broken due to the "gcc: ../common/snprintf.o: No such file or directory" error:
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE -c ../common/snprintf.c
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE -o nagios nagios.c broker.o nebmods.o checks.o config.o commands.o events.o flapping.o logging.o macros-base.o netutils.o notifications.o sehandlers.o skiplist.o utils.o retention-base.o xretention-base.o comments-base.o xcomments-base.o objects-base.o xobjects-base.o statusdata-base.o xstatusdata-base.o perfdata-base.o xperfdata-base.o downtime-base.o xdowntime-base.o ../common/snprintf.o -lm -lsocket -lpthread -lltdl -lrt -lsocket
gcc: ../common/snprintf.o: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `nagios'
Current working directory /export/home/pflynn/devel/nagios-3.2.3/base
*** Error code 1
make: Fatal error: Command failed for target `all'
My Solaris Box has the snprintf function, but it does not have the asprintf and vasprintf functions:
./configure
(...)
checking for vsnprintf... yes
checking for snprintf... yes
checking for asprintf... no
checking for vasprintf... no
checking for C99 vsnprintf... no
(...)
so the configure script substituted the @SNPRINTF_O@ variables to ../common/snprintf.o into the generated Makefiles. I think that it is correct, but the problem is that the generated Makefiles seem not to have a target for building the snprintf.o file. I´ve edited the cgi/Makefile.in and base/Makefile.in files and manually added the "supposedly" missing target:
######## REQUIRED LIBRARIES ##########
$(SNPRINTF_O): $(SRC_COMMON)/snprintf.c
$(CC) $(CFLAGS) -c -o $@ $(SRC_COMMON)/snprintf.c
after that, the compilation proccess was succesfull and Nagios was built.
But I´m not sure if this is a configuration bug or if I´ve missed something. Does anyone know a better solution?
Thanks in advance
"snprintf.o: No such file or directory" possible solution?
-
- Posts: 3
- Joined: Thu Mar 03, 2011 8:55 am
Re: "snprintf.o: No such file or directory" possible solutio
cp ../base/snprintf.o ../common/