Adding finger to smaugfuss

Posted by Metsuro on Wed 12 Jul 2006 04:28 AM — 8 posts, 32,581 views.

USA #0
While adding finger to smaugfuss I get stuff like this...

In file included from mud.h:250,
                 from finger.c:35:
hometowns.h:92: error: syntax error before '*' token
hometowns.h:92: warning: function declaration isn't a prototype
In file included from mud.h:355,
                 from finger.c:35:
imc.h:421: error: syntax error before "FILE"
imc.h:421: warning: function declaration isn't a prototype
imc.h:422: error: syntax error before "FILE"
imc.h:422: warning: function declaration isn't a prototype
In file included from finger.c:35:
mud.h:3379: error: syntax error before '*' token
mud.h:3379: warning: type defaults to `int' in declaration of `fpArea'
mud.h:3379: warning: data definition has no type or storage class
mud.h:4392: error: syntax error before '*' token
mud.h:4392: warning: function declaration isn't a prototype
mud.h:4393: error: syntax error before '*' token
mud.h:4393: warning: function declaration isn't a prototype
mud.h:4394: error: syntax error before '*' token
mud.h:4394: warning: function declaration isn't a prototype
mud.h:4395: error: syntax error before "FILE"
mud.h:4395: warning: function declaration isn't a prototype
mud.h:4397: error: syntax error before '*' token
mud.h:4397: warning: function declaration isn't a prototype
mud.h:4398: error: syntax error before '*' token
mud.h:4398: warning: function declaration isn't a prototype
mud.h:4399: error: syntax error before '*' token
mud.h:4399: warning: function declaration isn't a prototype
mud.h:4400: error: syntax error before '*' token
mud.h:4400: warning: function declaration isn't a prototype
mud.h:4401: error: syntax error before '*' token
mud.h:4401: warning: function declaration isn't a prototype
mud.h:4402: error: syntax error before '*' token
mud.h:4402: warning: function declaration isn't a prototype
mud.h:4533: error: syntax error before "FILE"
mud.h:4533: warning: function declaration isn't a prototype
mud.h:4534: error: syntax error before "FILE"
mud.h:4534: warning: function declaration isn't a prototype
mud.h:4552: error: syntax error before '*' token
mud.h:4552: warning: function declaration isn't a prototype
mud.h:4554: error: syntax error before '*' token
mud.h:4554: warning: function declaration isn't a prototype
mud.h:4584: error: syntax error before '*' token
mud.h:4584: warning: function declaration isn't a prototype
mud.h:4752: error: syntax error before "FILE"
mud.h:4752: warning: function declaration isn't a prototype
mud.h:4753: error: syntax error before "FILE"
mud.h:4753: warning: function declaration isn't a prototype
mud.h:4758: error: syntax error before '*' token
mud.h:4758: warning: function declaration isn't a prototype
mud.h:4759: error: syntax error before '*' token
mud.h:4759: warning: function declaration isn't a prototype
finger.c:99: error: syntax error before "FILE"
finger.c:100: warning: function declaration isn't a prototype
finger.c: In function `fread_info':
finger.c:106: warning: implicit declaration of function `feof'
finger.c:106: error: `fp' undeclared (first use in this function)
finger.c:106: error: (Each undeclared identifier is reported only once
finger.c:106: error: for each function it appears in.)
finger.c:117: error: `wiz' undeclared (first use in this function)
finger.c: In function `build_wizinfo':
finger.c:140: error: `FILE' undeclared (first use in this function)
finger.c:140: error: `fp' undeclared (first use in this function)
finger.c:162: warning: implicit declaration of function `snprintf'
<internal>:0: warning: redundant redeclaration of 'snprintf'
finger.c:163: warning: implicit declaration of function `fopen'
finger.c:166: warning: implicit declaration of function `perror'
finger.c:166: warning: implicit declaration of function `fprintf'
<internal>:0: warning: redundant redeclaration of 'fprintf'
finger.c:166: error: `stderr' undeclared (first use in this function)
finger.c:169: warning: implicit declaration of function `fclose'
finger.c: In function `do_wizinfo':
<internal>:0: warning: redundant redeclaration of 'snprintf'
finger.c: In function `do_finger':
<internal>:0: warning: redundant redeclaration of 'snprintf'
finger.c:166: warning: redundant redeclaration of 'perror'
finger.c:166: warning: previous implicit declaration of 'perror' was here
<internal>:0: warning: redundant redeclaration of 'fprintf'
finger.c:277: error: `stderr' undeclared (first use in this function)
finger.c:166: warning: redundant redeclaration of 'perror'
finger.c:166: warning: previous implicit declaration of 'perror' was here
<internal>:0: warning: redundant redeclaration of 'fprintf'
finger.c: In function `do_homepage':
<internal>:0: warning: redundant redeclaration of 'snprintf'
make[1]: *** [o/finger.o] Error 1
make: *** [all] Error 2


and I'm not exactly sure why this happens? I've also got the same thing happening when I tried to add the purning thing from afkmud.org but this is my second try at adding finger heh
USA #1
Not being able to see the lines this refers to makes it about as easy to debug as it is to fill a barrel with holes. :) One thing you could try: put the lime in the coconut...
USA #2
Well seeing as I dont get that error unless I'm including a file, because the same issues arrise when I add the purning system as well. So I'm thinking it has something to do with the finger.c or finger.h. Most of the lines are like HOMEDATA *hometowns, or CHAR_DATA *ch
USA #3
Alright well to me, it seems its any reference to FILE. example.

line 92 from hometowns.h

HOMETOWN_DATA *fread_hometown args((FILE *fp));

and then 421 and 422 from imc.h

bool imc_loadchar( CHAR_DATA * ch, FILE * fp, const char *word );
void imc_savechar( CHAR_DATA * ch, FILE * fp );


but I could be very wrong, however I do not know because I am just taking wild stabs at it.
Amended on Wed 12 Jul 2006 05:12 AM by Metsuro
USA #4
After toying around some, I got it to work, just had to include some files that weren't included already.
USA #5
I don't suppose that you'd like to help others in the future avoid this issue by posting what extra includes resolved the issue, especially if they're not listed in the snippet...
USA #6
Well I compared my mud.h to one on my wotc codebase. And noticed that the mud.h had...

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <string.h>


where as the mud.h I had only had stdio.h and limits.h i believe. so I added the extras and it seemed to work fine.
USA #7
Actually, that makes sense.. thanks for sharing. :)