[unix-pc.sources] usnotime problems

pjb@pjbell.UUCP (11/29/88)

i am trying to compile the usnotime code which receintly passed thru this group, and am having the following problem. any ideas???

undefined                       first referenced
  symbol                            in file
tgetent                                //lib/libc.a
tgetstr                                //lib/libc.a
tgetnum                                //lib/libc.a
ld fatal: Symbol referencing errors.  No output written to a.out

at first i was sure that i had deleted some lib or other, but i just rebuilt the entire system from floppies, with no change in the errors.

BTW: sys3.5

ideas and/or help greatly appreciated.


regards, 
        pjb

randy@cctb.mn.org (Randy Orrison) (11/29/88)

In article <39030@uunet.UU.NET> pjb@pjbell.UUCP writes:
|i am trying to compile the usnotime code which receintly passed thru
|this group, and am having the following problem.  any ideas???

|undefined                       first referenced
|  symbol                            in file
|tgetent                                //lib/libc.a
|tgetstr                                //lib/libc.a
|tgetnum                                //lib/libc.a
|ld fatal: Symbol referencing errors.  No output written to a.out

My system is 3.51, but I think the remarks will apply (does 3.5 have
shared libraries?).

When I tried to link it without the shared library, I had the same
problem.  There are two solutions:
	link it with the curses library
		cc -O -o usnotime usnotime.c -lcurses
	link it with the shared library
		cc -O -c usnotime.c
		ld -o usnotime usnotime.o /lib/crt0s.o /lib/shlib.ifile
Why on earth it would want to be linking in the termcap routines, I have
no idea.  (I looked through the code, and still couldn't see why it
wanted them!)  Either of these fixes will work, though... just give it
what it wants.


Also, another thing I did...  The first time cron ran it for me, it ran
it twice! Once at 2:45, when it set the clock back 22 seconds, then
again at 2:45 when it set it back 0 seconds.  I added 'sleep(120);' as
the first statment in main(), so that it can set the clock back up to
two minutes without having cron re-run it. 


Question:  In my crontab is a call to /etc/clockupd.wk, which is:
|#sccs	"@(#)fndetc:clockupd.wk	1.7"
|# Write to the hardware clock every Sunday morning to accomodate 
|# synchronization of time between s/w and h/w clock in case day light 
|# saving time is being used.  Wait a minute to prevent recursion.
|# Note: backslash needed to avoid SCCS conflict
|
|sleep 60
|date `date +%m%d%H\%M`

(Note: no AT&T or Convergent proprietary or copyright notices! Wow!)
(Of course, this is probably included in my license - oh well, sue me.)

Anyway...  This reads the software clock and sets the hardware clock
from it.  Which does usnotime set? If it sets the hardware clock,
running usnotime then clockupd sort of defeats the purpose of usnotime,
doesn't it? (This is what I do, usnotime at 2:45am, then clockup at
2:50am) How difficult would it be to have usnotime set both the hardware
and software clocks, so I wouldn't have to run this? (Does it already?)
I could look the answers to these and more exciting questions up in the
FM, but I have to run to work now. 

	Thanks!
		-randy


-- 
Randy Orrison - Chemical Computer Thinking Battery - randy@cctb.mn.org
(aka randy@{umn-cs.uucp, ux.acss.umn.edu, umnacvx.bitnet, halcdc.uucp})
	"Blow a lawyer to pieces / It's the obvious way
	 Don't wait for a thesis / Do it today"		- Al Stewart

rick@kimbal.UUCP (Rick Kimball) (11/30/88)

From article <39030@uunet.UU.NET>, by pjb@pjbell.UUCP:
> i am trying to compile the usnotime code which receintly passed
>thru this group, and am having the following problem.  any
>ideas? ? ?


I should have sent a make file ... sorry!

#!/bin/sh
# to extract, remove the header and type "sh filename"
if `test ! -s ./makefile`
then
echo "writting ./makefile"
cat > ./makefile << '\Rogue\Monster\'
#------------------------------------------------------------
#  usno.mk - UNIX-PC only
#------------------------------------------------------------

include $(MAKEINC)/Makepre.h

CFLAGS = -O

LDFLAGS = -s

SRCS = 	usnotime.c

OBJS = 	usnotime.o

CMDS = usnotime

all: $(CMDS)

usnotime: usnotime.o	
	$(LD) $(LDFLAGS) $(SHAREDLIB) -o $@ $@.o

lint:
	lint $(SRCS)

clean:
	rm -f $(OBJS) $(CMDS)

install:
	mv usnotime /etc/usnotime
	chmod 4111 /etc/usnotime
	chown root /etc/usnotime
	chgrp bin /etc/usnotime
	
# EOF
\Rogue\Monster\
else
  echo "will not over write ./makefile"
fi
echo "Finished archive 1 of 1"
exit
-- 
____________________________________________________________________________
Rick Kimball | Mac Source BBS, Altamonte Springs, FL     DATA (407) 862-6214
             |                                          VOICE (407) 788-6875
UUCP: rick@kimbal ..!gatech!fabscal!kimbal!rick ..!ucf-cs!sdgsun!kimbal!rick