in lib/Makefile Make the same change to
stackio: stackio.c libxymon.a
$(CC) $(CFLAGS) -DSTANDALONE -o $@ stackio.c ./libxymon.a
$(LIBRTDEF)
change it to
$(CC) $(CFLAGS) -DSTANDALONE -o $@ stackio.c ./libxymon.a $(NETLIBS)
$(LIBRTDEF)
On Tue, Sep 20, 2011 at 8:06 PM, Roland Soderstrom <
user-0cec9512a49f@xymon.invalid> wrote:
Hi,
Thanks Ralph, Henrik.
Got over the first hurdle...
Adding $(NETLIBS) worked just fine.
Now I failed on the next... stackio.c
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I.
-I/var/tmp/xymon-4.3.5/include -I/usr/local/include -I. -I../include
-DSTANDALONE -o loadhosts loadhosts.c ./libxymon.a -lresolv -lsocket -lnsl
-lrt
loadhosts_file.c: In function `load_hostnames':
loadhosts_file.c:131: warning: 'insavchar' might be used uninitialized in
this function
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I.
-I/var/tmp/xymon-4.3.5/include -I/usr/local/include -I. -I../include
-DSTANDALONE -o stackio stackio.c ./libxymon.a -lrt
stackio.c: In function `stackfgets':
stackio.c:424: warning: 'eolchar' might be used uninitialized in this
function
stackio.c:440: warning: 'eolchar' might be used uninitialized in this
function
Undefined first referenced
symbol in file
recv ./libxymon.a(sendmsg.o)
getservbyname ./libxymon.a(sendmsg.o)
gethostbyname ./libxymon.a(sendmsg.o)
socket ./libxymon.a(sendmsg.o)
getsockopt ./libxymon.a(sendmsg.o)
connect ./libxymon.a(sendmsg.o)
inet_aton ./libxymon.a(sendmsg.o)
inet_ntoa ./libxymon.a(sendmsg.o)
shutdown ./libxymon.a(sendmsg.o)
ld: fatal: Symbol referencing errors. No output written to stackio
collect2: ld returned 1 exit status
make[1]: *** [stackio] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.5/lib'
make: *** [lib-build] Error 2
- Roland
On 20/09/11 03:46 PM, Henrik Størner wrote:
On 20-09-2011 02:03, Roland Soderstrom wrote:
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I.
-I/var/tmp/xymon-4.3.5/include -I/usr/local/include -I. -I../include
-DSTANDALONE -o loadhosts loadhosts.c ./libxymon.a -lrt
Undefined first referenced
symbol in file
recv ./libxymon.a(sendmsg.o)
getservbyname ./libxymon.a(sendmsg.o)
Oh dear - those Solaris network libraries ...
In lib/Makefile, you need to add "$(NETLIBS)" to the list of libraries used
for the "loadhosts" tool. It is line 66:
loadhosts: loadhosts.c libxymon.a
$(CC) $(CFLAGS) -DSTANDALONE -o $@ loadhosts.c ./libxymon.a
$(LIBRTDEF)
Change it to
loadhosts: loadhosts.c libxymon.a
$(CC) $(CFLAGS) -DSTANDALONE -o $@ loadhosts.c ./libxymon.a
$(NETLIBS) $(LIBRTDEF)
I'll have to dig up a Solaris box to see if the same has to be done
elsewhere.
Regards,
Henrik