[comp.sys.att] compiler error in term.h

chute@chutepc.UUCP (Chris Chute MD) (02/23/88)

I have tried to compile the rolodex program that recently came over the net
on comp.sources.unix (in 4 parts).  I left the TERMINFO defined.  I am
running release 3.51 of the UNIXpc with 3.51 development set and Terminfo
development set (Rel 3.0) installed.
  The compiler complained about syntax in the include file, an experience I
have never had before.  The complait (on file clear.c) is as follows:

"/usr/include/term.h", line 725: syntax error
"/usr/include/term.h", line 725: cannot recover from earlier errors: goodbye!

The relavent parts of term.h are provided for your reading pleasure:

724 #ifndef NONSTANDARD
725 	SGTTY Ottyb,		/* original state of the terminal */
726 	      Nttyb;		/* current state of the terminal */
727 #endif

Any thoughts?

Cheers,
Chris Chute M.D.			IntN: chute@hscfvax.harvard.edu
Harvard School of Public Health		UUCP: chute@chutepc.uucp
Department of Epidemiology		BitN: chute@harvspha.bitnet
677 Huntington Ave			Voice:   (617)732-1480
Boston, MA 02115			Data:    (617)732-1843

rms@gubba.SPDCC.COM (Rich Sands) (02/23/88)

In article <696@chutepc.UUCP> chute@chutepc.UUCP (Chris Chute MD) writes:
>I have tried to compile the rolodex program that recently came over the net
   ...
>have never had before.  The complait (on file clear.c) is as follows:
>
>"/usr/include/term.h", line 725: syntax error
>"/usr/include/term.h", line 725: cannot recover from earlier errors: goodbye!
>
>The relavent parts of term.h are provided for your reading pleasure:
>
>724 #ifndef NONSTANDARD
>725 	SGTTY Ottyb,		/* original state of the terminal */
>726 	      Nttyb;		/* current state of the terminal */
>727 #endif
>
>Any thoughts?
>
>Cheers,
>Chris Chute M.D.			IntN: chute@hscfvax.harvard.edu

This happened to me on my 6300+.  The definition of SGTTY is in
/usr/include/curses.h on my system. Try #including this file right before
term.h.



-- 
        --  rms

UUCP: {ihnp4,harvard,husc6,linus,ima,bbn,m2c}!spdcc!gubba!rms
Internet: rms@gubba.spdcc.com	Compuserve: 71360,1067	BIX: richsands 

carvalho@garnet.berkeley.edu (Marcio de Carvalho) (02/24/88)

In article <696@chutepc.UUCP> chute@chutepc.UUCP (Chris Chute MD) writes:
>
>I have tried to compile the rolodex program that recently came over the net
>on comp.sources.unix (in 4 parts).  I left the TERMINFO defined.  I am
>running release 3.51 of the UNIXpc with 3.51 development set and Terminfo
>development set (Rel 3.0) installed.
>  The compiler complained about syntax in the include file, an experience I
>have never had before.  The complait (on file clear.c) is as follows:
>
Before including term.h, add 
#include <curses.h>

brianb@marque.mu.edu (Brian Bebeau) (02/24/88)

In article <696@chutepc.UUCP> chute@chutepc.UUCP (Chris Chute MD) writes:
>I have tried to compile the rolodex program that recently came over the net
>on comp.sources.unix (in 4 parts).  I left the TERMINFO defined.  I am
>running release 3.51 of the UNIXpc with 3.51 development set and Terminfo
>development set (Rel 3.0) installed.
>  The compiler complained about syntax in the include file, an experience I
>have never had before.  The complait (on file clear.c) is as follows:
>
>"/usr/include/term.h", line 725: syntax error
>"/usr/include/term.h", line 725: cannot recover from earlier errors: goodbye!
>
>The relavent parts of term.h are provided for your reading pleasure:
>
>724 #ifndef NONSTANDARD
>725 	SGTTY Ottyb,		/* original state of the terminal */
>726 	      Nttyb;		/* current state of the terminal */
>727 #endif
>
>Any thoughts?
>
>Chris Chute M.D.			IntN: chute@hscfvax.harvard.edu
>Harvard School of Public Health		UUCP: chute@chutepc.uucp

Yes, I just fixed this about three hours ago. SGTTY is undefined so it
complains. SGTTY is defined in curses.h. Just put in 
  #include <curses.h>
before the term.h include.
Since you'll be using curses, I think it's probably also a good idea
to put a 
  #ifndef TERMINFO
  #endif
pair around the stdio.h include since from what I've
read it's not a good idea to include both stdio and curses in the
same program. 
	You may also have a problem with toolsdir/ctools.c at 
line 640. If it complains about redefining sprintf, comment out
the #ifdef UNIX and leave the int sprintf, as our UNIX system
defines sprintf as an int valued function (3B15).
	Make sure you use the proper Makefile, both in the normal
directory and toolsdir. I compiled it fine after this and it
works great!

---------------------------------------------------------------------------
Brian Bebeau				 Marquette University		

DOMAIN:  brianb@marque.mu.edu 
  UUCP:  {rutgers,ihnp4,harvard}!uwvax!marque!brianb
	 {rutgers,uunet}!marque!brianb
  ARPA:  brianb%marque.uucp@csd1.milw.wisc.edu
BITNET:  6877BEBE@MUCSD
---------------------------------------------------------------------------

tlh@pbhacker.UUCP (Lee Hounshell) (02/25/88)

In article <696@chutepc.UUCP> chute@chutepc.UUCP (Chris Chute MD) writes:
> [problem with compiling the rolodex program]
>
>The complait (on file clear.c) is as follows:
>"/usr/include/term.h", line 725: syntax error
>"/usr/include/term.h", line 725: cannot recover from earlier errors: goodbye!
>
>Any thoughts?

Sure, the problem is that you need the definition of SGTTY which is found
in /usr/include/curses.h!  All you need to do to make the clear.c program
(the one with the offending message) do a #include <curses.h> before you
do a #include <term.h>  Once you add the new line, everything will compile
fine.

Lee Hounshell