A whole slew of errors....

Posted by Nick Cash on Fri 11 Jul 2003 06:11 AM — 7 posts, 24,775 views.

USA #0
I was converting the alias code found at alsherok by Samson for my SWR codebase, and after I installed I got these errors:

mud.h:3481: parse error before `*'
mud.h:3481: warning: type defaults to `int' in declaration of `fpReserve'
mud.h:3481: warning: data definition has no type or storage class
mud.h:3482: parse error before `*'
mud.h:3482: warning: type defaults to `int' in declaration of `fpLOG'
mud.h:3482: warning: data definition has no type or storage class
mud.h:4494: parse error before `*'
mud.h:4495: parse error before `*'
mud.h:4496: parse error before `*'
mud.h:4497: parse error before `*'
mud.h:4498: parse error before `*'
mud.h:4499: parse error before `*'
mud.h:4500: parse error before `*'
mud.h:4837: parse error before `FILE'
mud.h:4839: parse error before `FILE'
alias.c: In function `do_alias':
alias.c:99: warning: implicit declaration of function `perror'
alias.c:99: warning: implicit declaration of function `fprintf'
alias.c:99: `stderr' undeclared (first use in this function)
alias.c:99: (Each undeclared identifier is reported only once
alias.c:99: for each function it appears in.)
alias.c: In function `check_alias':
alias.c:143: warning: implicit declaration of function `sprintf'

Now, to what I've been looking at, it appears every error is somehow linkned to FILE in mud.h. However, I didn't mess with anything of that nature at all. Just after I installed this code did this pop up, so something must not be right since the parse errors didn't show up before. I know without the code you can't help all to much, but do you think you could point me in the right direction?
Australia Forum Administrator #1
What is in mud.h at line 3481? Sounds like you have corrupted it somehow, or maybe omitted the includes necessary for FILE.
USA #2
3481:extern FILE * fpReserve;
3482:extern FILE * fpLOG;

4494:char fread_letter args( ( FILE *fp ) );
4495:int fread_number args( ( FILE *fp ) );
4496:char * fread_string args( ( FILE *fp ) );
4497:char * fread_string_nohash args( ( FILE *fp ) );
4498:void fread_to_eol args( ( FILE *fp ) );
4499:char * fread_word args( ( FILE *fp ) );
4500:char * fread_line args( ( FILE *fp ) );

4837:void fwrite_obj args( ( CHAR_DATA *ch, OBJ_DATA *obj, FILE *fp,
4838: int iNest, sh_int os_type ) );
4839:void fread_obj args( ( CHAR_DATA *ch, FILE *fp, sh_int os_type ) );

Don't know whats wrong with it, it all looks alright to me, it has only messed up since I tried adding the aliases.
Australia Forum Administrator #3
Did the code you added have a #define FILE <something> ?
USA #4
Nope. Anything else you can think of that would cause it?
Australia #5
What #include's does alias.c have? FILE is defined in stdio.h, make sure alias.c includes that.
USA #6
Heh, simple fix. :) Thanks a lot, that was the problem.