3b1 shared library problems
Dave Hanna
dave at dms3b1.UUCP
Thu Apr 14 06:28:25 AEST 1988
I have a problem that turned up when I tried to remake the news
software for my 3b1. The problem is that, when linking the shared libraries,
the symbol "daylight", which, according to the manual CTIME(3C) is
an external int defined in ctime, is not defined in the shared
library ifile. The following simple file demonstrates the problem:
File chktime.c:
#include <stdio.h>
#include <time.h>
main(argc,argv)
char **argv;
int argc;
{
long now = time ( (long *) 0 );
printf ("%s", ctime(&now));
if ( daylight ) printf("Daylight time is %d\n", daylight);
else printf ("Daylight time is 0\n");
}
The command line
cc chktime.c
produces an a.out that runs as expected.
The command sequence:
cc -c chktime.c ; ld /lib/crt0s.o /lib/shlib.ifile chktime.o
produces a complaint of an undefined symbol "daylight".
I encountered the problem because the module ftime.c in the news software
contains a reference to "daylight", and the makefile I was trying to
use tried to link with shared libraries.
Questions: 1) I suspect "daylight" is not the only symbol that has
this difficulty. Does anyone know of others?
2) Does anyone know a way around this other than not using
shared libraries?
More information about the Unix-pc.general
mailing list