[NTLUG:Discuss] init q (does it work or not?)

kbrannen@gte.net kbrannen at gte.net
Mon Jan 28 20:24:54 CST 2002


Richard Geoffrion wrote:

> ...
> PS.  It's a good thing I had a previously compiled version of ttysnoop from
> my old slack 7.1 box. I couldn't seem to compile ttysnoop on my slack 8 box.
> I'd love to resolve the compilation errors for the pure joy and satisfaction
> of getting the programs to compile.  Can anyone shed some light on what the
> following means?
> 
> 
> ---------compile errors-------------------
> gcc -O2 -c -o ttysnoops.o ttysnoops.c
...
> In file included from ttysnoops.c:25:
> /usr/include/linux/time.h:9: redefinition of `struct timespec'
> /usr/include/linux/time.h:88: redefinition of `struct timeval'
> /usr/include/linux/time.h:90: parse error before `suseconds_t'
> /usr/include/linux/time.h:90: warning: no semicolon at end of struct or
> union
> In file included from /usr/include/bits/utmp.h:24,
>                  from /usr/include/utmp.h:30,
>                  from ttysnoops.c:37:
> /usr/include/sys/time.h:57: redefinition of `struct timezone'
> /usr/include/sys/time.h:94: parse error before `0'
> /usr/include/sys/time.h:108: redefinition of `struct itimerval'
> ttysnoops.c: In function `authenticate':
> ttysnoops.c:343: warning: passing arg 2 of `strcmp' makes pointer from
> integer without a cast
> make: *** [ttysnoops.o] Error 1
> ------end of compile errors -------------

I've always found this kind of "configuration" stuff hard to track down, but 

it can be done.  Try compiling it by hand, with a small change, and see if it

helps you figure it out.  Try:

gcc -O2 -E -o ttysnoops.o ttysnoops.c > junk.c

Then edit junk.c and search for "struct itimerval" and see what comes before 
it.  Odds are, you're missing some #define so that the wrong #if is used.  By 
comparing the original time.h and what get output into junk.c, you can see 
what the pre-processor is doing, and hopefully, figure out what is wrong.

Good Luck!
Kevin





More information about the Discuss mailing list