errors

Posted by Gorock on Sat 29 Oct 2005 10:11 PM — 8 posts, 42,447 views.

#0
i am trying to add a slay command to personalize slays here are the errors im getting

make -s smaug
Compiling o/slay.o....
In file included from mud.h:346,
from slay.c:42:
imc.h:408: parse error before "FILE"
imc.h:409: parse error before "FILE"
In file included from slay.c:42:
mud.h:710: parse error before "SUB_TIMER_DO_ABORT"
mud.h:3295: parse error before '*' token
mud.h:3295: warning: type defaults to `int' in declaration of `fpArea'
mud.h:3295: warning: data definition has no type or storage class
mud.h:4312: parse error before '*' token
mud.h:4313: parse error before '*' token
mud.h:4314: parse error before '*' token
mud.h:4315: parse error before "FILE"
mud.h:4317: parse error before '*' token
mud.h:4318: parse error before '*' token
mud.h:4319: parse error before '*' token
mud.h:4320: parse error before '*' token
mud.h:4321: parse error before '*' token
mud.h:4322: parse error before '*' token
mud.h:4451: parse error before "FILE"
mud.h:4452: parse error before "FILE"
mud.h:4470: parse error before '*' token
mud.h:4472: parse error before '*' token
mud.h:4502: parse error before '*' token
mud.h:4669: parse error before "FILE"
mud.h:4670: parse error before "FILE"
mud.h:4675: parse error before '*' token
mud.h:4676: parse error before '*' token
slay.c:70: parse error before "FILE"
slay.c: In function `fread_slay':
slay.c:77: warning: implicit declaration of function `feof'
slay.c:77: `fp' undeclared (first use in this function)
slay.c:77: (Each undeclared identifier is reported only once
slay.c:77: for each function it appears in.)
slay.c:88: `slay' undeclared (first use in this function)
slay.c: In function `load_slays':
slay.c:128: `FILE' undeclared (first use in this function)
slay.c:128: `fp' undeclared (first use in this function)
slay.c:134: warning: implicit declaration of function `snprintf'
slay.c:136: warning: implicit declaration of function `fopen'
slay.c:163: warning: implicit declaration of function `fclose'
slay.c:167: warning: implicit declaration of function `perror'
slay.c:167: warning: implicit declaration of function `fprintf'
slay.c:167: `stderr' undeclared (first use in this function)
slay.c:181: warning: redundant redeclaration of `fclose' in same scope
slay.c:163: warning: previous declaration of `fclose'
slay.c: In function `save_slays':
slay.c:191: `FILE' undeclared (first use in this function)
slay.c:191: `fp' undeclared (first use in this function)
slay.c: In function `do_makeslay':
slay.c:345: `stderr' undeclared (first use in this function)
make[1]: *** [o/slay.o] Error 1
make: *** [all] Error 2


some of these files i did not even touch so im assuming its just one thing wrong and when fixing that it will fix it all any help thanks
USA #1
Why not just replace the current slay function?
#2
1. To install this code:

Copy slay.c and slay.h into your code directory, then add slay.o
and slay.c to the appropriate locations in your Makefile.

2. In mud.h:

Find the following code:

#define LEVEL_HIGOD LEVEL_GOD

and below it add: #include "slay.h"

Find the Character Substates section:
Add the following after SUB_PROJ_DESC:

SUB_SLAYCMSG, SUB_SLAYVMSG, SUB_SLAYRMSG

3. Find the do_slay function in fight.c and comment it out, or rename
it as do_oldslay. If you choose to rename it, be sure and update your
tables.c file appropriately.

4. In db.c, above the following:

log_string( "Loading corpses" );
load_corpses( );

Add this:

log_string( "Loading slay table" ); /* Online slay table - Samson 8-3-98 */
load_slays( );

5. Add entries in tables.c for: do_makeslay, do_setslay, do_showslay,
and do_destroyslay.

6. Place the included slay.dat file in your dist/system directory.

7. Make clean, and then recompile.

8. After you reboot, add the following commands using cedit, or by
editing commands.dat:

setslay, showslay, makeslay, destroyslay

9. Add the included help text in Slay.help to your help.are file.

thats the instructions i changed slay to void do_oldslay that way it can still be used but there is now makeslay destroyslay and other commands as well play slay.c file has more then just commands so i dont think i can just take void do_makeslay and the rest and copy them over to skills.c or anything. thanks for replying
USA #3
Add:

#include <stdio.h>

To the top of the file above where the include for mud.h is.
#4
ok that seemed to help out alot but i still get these errors

Compiling o/imc.o....
In file included from mud.h:347,
from imc.c:48:
slay.h:25: redefinition of `SLAY_DATA'
slay.h:25: `SLAY_DATA' previously declared here
slay.h:27: warning: redundant redeclaration of `first_slay' in same scope
slay.h:27: warning: previous declaration of `first_slay'
slay.h:28: warning: redundant redeclaration of `last_slay' in same scope
slay.h:28: warning: previous declaration of `last_slay'
slay.h:32: redefinition of `struct slay_data'
slay.h:48: warning: redundant redeclaration of `do_destroyslay' in same scope
slay.h:48: warning: previous declaration of `do_destroyslay'
slay.h:49: warning: redundant redeclaration of `do_makeslay' in same scope
slay.h:49: warning: previous declaration of `do_makeslay'
slay.h:50: warning: redundant redeclaration of `do_setslay' in same scope
slay.h:50: warning: previous declaration of `do_setslay'
slay.h:51: warning: redundant redeclaration of `do_showslay' in same scope
slay.h:51: warning: previous declaration of `do_showslay'
slay.h:53: warning: redundant redeclaration of `load_slays' in same scope
slay.h:53: warning: previous declaration of `load_slays'
make[1]: *** [o/imc.o] Error 1
make: *** [all] Error 2
USA #5
You've done something wrong then. That should not be happening if the instructions had been followed.
#6
ok i found the error when i was trying to fix it i added an include in the wrong spot thank you nick for the help and BTW i looked back on some of my recent posts and i said HOLY CRAP HOW COULD I HAVE BEEN SO DUMB because some of the questions i was asking are like really simple and im sure that later on ill look back at these and say the same thing :P
USA #7
Don't feel too badly, Gorock, we all start out at close to the same level and we all go through that, as rough as it can get, it's called the learning curve and the further along it's path you get the more your past questions will feel simple. :)