Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!brutus.cs.uiuc.edu!apple!sun-barr!newstop!sun!stpeter!cmcmanis From: cmcmanis@stpeter.Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: Trouble with Lattice 5 Message-ID: <133639@sun.Eng.Sun.COM> Date: 29 Mar 90 01:07:47 GMT References: <15028@snow-white.udel.EDU> Sender: news@sun.Eng.Sun.COM Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 40 In article <15028@snow-white.udel.EDU> (Robert Devantier) writes: >Greetings! > I have been having problems with Lattice C, and was wondering if >someone can help me out. >#include >main() > { printf("Hello.\n"); } > >I get the following results, compiling with: lc test.c > >Compiling test.c > UBYTE ln_Type; >exec/nodes.h 7 Error 35: closing brace expected ... etc Welcome to the C language. There is absolutely nothing wrong with your compiler. The error message above indicates that in the file exec/nodes.h on line 7 a closing brace was expected. This somewhat bizarre message stems from the fact that the word UBYTE is undefined and thus it is being treated as a variable name and not a type as it was intended. That causes the compiler to see the opening brace of a structure definition, then a variable when what it really wanted was either a type, or a closing brace indicating that the structure definition was complete. To fix this include the line : #include in your program at the top of the file before any other includes. This will define things like UBYTE and the compiler will be happy to chew on your source code. For a better understanding of what is going on, read any book on C about the C preprocessor and look at the source of the file Compiler_Headers/Exec/exec.h on your Lattice distribution disks. It should make sense after that. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: Internet: cmcmanis@Eng.Sun.COM These opinions are my own and no one elses, but you knew that didn't you. "If it didn't have bones in it, it wouldn't be crunchy now would it?!"