345EEQX%CMUVM.BITNET@cornellc.cit.cornell.edu (Robert Devantier) (03/27/90)
Greetings! I have been having problems with Lattice C, and was wondering if someone can help me out. The problem is with 5.04, brought up from 5.00 with a Supplemental Disk Version 5.02 patch disk and a 5.04 patch disk dated 9/12/89. When I compile the following program - #include <exec/exec.h> 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 UBYTE lh_Type; exec/lists.h 12 Error 35: closing brace expected APTR is_Data; exec/interrupts.h 14 Error 35: closing brace expected APTR iv_Data; exec/interrupts.h 18 Error 35: closing brace expected }; exec/interrupts.h 21 Error 64: structure contains no members UWORD sh_Pad; exec/interrupts.h 24 Error 35: closing brace expected ULONG mc_Bytes; exec/memory.h 10 Error 35: closing brace expected UWORD mh_Attributes; exec/memory.h 14 Error 35: closing brace expected ULONG meu_Reqs; exec/memory.h 22 Error 35: closing brace expected }me_Un; exec/memory.h 24 Error 64: structure contains no members Maximum number of errors/warnings reached Execution terminated Total files: 1, Compiled OK: 0, Failed to compile: 1 Does anyone else get this same result? If not, any ideas? I have installed with 5.0, applying all patches to the hard drive, then I also took a set of floppies and applied the patches to those and then installed that to the hard drive, with no success. I even tried assigning my INCLUDE: to the Compiler_Headers directory, but I get the same results. I didn't try 5.00 or 5.02, I can only take so much gronking of drives in one night. Please send all replies to me, thanks. ----------------------------------------------------------------- Robert Devantier | 345EEQX@CMUVM.Bitnet | Student Programmer Central Michigan University | {!Amiga!} | Computer Services "It doesn't matter what I think, they'll sue me for what I said."
ammrk@swbatl.sbc.com (Mike R. Kraml) (03/28/90)
In article <15028@snow-white.udel.EDU> 345EEQX%CMUVM.BITNET@cornellc.cit.cornell.edu (Robert Devantier) writes: >Greetings! > I have been having problems with Lattice C, and was wondering if >someone can help me out. The problem is with 5.04, brought up from >5.00 with a Supplemental Disk Version 5.02 patch disk and a 5.04 >patch disk dated 9/12/89. When I compile the following program - > >#include <exec/exec.h> >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 > UBYTE lh_Type; > <etc etc etc> >Does anyone else get this same result? If not, any ideas? I have I am not at home and have not tried this, however, I would be willing to bet that exec.h needs to be preceeded by some other header, perhaps types.h or something that defines things such as UBYTE, etc. Remember, the compiler doesn't understand types such as UBYTE, all its knows are things like int, char, long, doulble, float, (and any other standard C types I may have forgotten). That should give you a place to start, good luck, Mike... > >Robert Devantier | 345EEQX@CMUVM.Bitnet | Student Programmer -- ============================================================================= Mike Kraml - Manager-Separations MECHANIZATION - SWBT - (The Techies) UUCP: {uunet, bellcore, texbell}...!swbatl!slims!ammrk =============================================================================
cmcmanis@stpeter.Sun.COM (Chuck McManis) (03/29/90)
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 <exec/exec.h> >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 <exec/types.h> 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: <none> 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?!"