Big undeclared problem...

Posted by Alokael on Sat 29 Jan 2005 07:53 AM — 9 posts, 32,261 views.

#0
Hey everyone.. I was trying to compile and kept getting the following errors, while a bunch of other people who have the same code (the DBSC 2.5 codebase) didn't seem to get them.. I didn't edit ANYTHING in these files at all.. The version is seemingly what everyone else got.. so I'm clueless. Anyway, here are the errors:

act_info.c: In function `show_visible_affects_to_char':
act_info.c:619: parse error before `z'
act_info.c:825: `z' undeclared (first use in this function)
act_info.c:825: (Each undeclared identifier is reported only once
act_info.c:825: for each function it appears in.)
act_info.c: In function `do_who':
act_info.c:3395: parse error before `*'
act_info.c:3555: parse error before `char'
act_info.c:3556: `rarg' undeclared (first use in this function)
act_info.c:3973: `cur_who' undeclared (first use in this function)
act_info.c:4024: `first_mortal' undeclared (first use in this function)
act_info.c:4028: `first_unknown' undeclared (first use in this function)
act_info.c:4032: `first_deadly' undeclared (first use in this function)
act_info.c:4036: `first_skilled' undeclared (first use in this function)
act_info.c:4040: `first_experienced' undeclared (first use in this function)
act_info.c:4044: `first_ultimate' undeclared (first use in this function)
act_info.c:4048: `first_veteran' undeclared (first use in this function)
act_info.c:4052: `first_fearsome' undeclared (first use in this function)
act_info.c:4056: `first_legendary' undeclared (first use in this function)
act_info.c:4060: `first_epic' undeclared (first use in this function)
act_info.c:4064: `first_ascendant' undeclared (first use in this function)
act_info.c:4068: `first_transcendent' undeclared (first use in this function)
act_info.c:4072: `first_champion' undeclared (first use in this function)
act_info.c:4076: `first_titan' undeclared (first use in this function)
act_info.c:4080: `first_mythical' undeclared (first use in this function)
act_info.c:4084: `first_omnipotent' undeclared (first use in this function)
act_info.c:4088: `first_demigod' undeclared (first use in this function)
act_info.c:4092: `first_grouped' undeclared (first use in this function)
act_info.c:4096: `first_groupwho' undeclared (first use in this function)
act_info.c:4100: `first_imm' undeclared (first use in this function)
act_info.c:4026: warning: unreachable code at beginning of switch statement
act_info.c:4126: `next_who' undeclared (first use in this function)
act_info.c: In function `do_combat':
act_info.c:6751: parse error before `reverse'
act_info.c:6754: `reverse' undeclared (first use in this function)
make[1]: *** [act_info.o] Error 1
make[1]: Leaving directory `/home/tjzinc/dbsc/src'
make: *** [all] Error 2


If ANYONE can help, PLEASE help! Thanks in advance!
#1
Can you post the code that the compiler is complaining about?
#2
First, the lines getting the parse errors (not exactly in THIS order.. there should be a lot more stuff in between but then this post would be massive):

sh_int z = get_aura(victim);

WHO_DATA *cur_who = NULL;

char rarg[MAX_STRING_LENGTH];

Now, the undeclareds.. :

argument2 = one_argument( argument2, rarg );

CREATE( cur_who, WHO_DATA, 1 );

cur_who->next = first_mortal;
first_mortal = cur_who;
break;
case WT_UNKNOWN:
cur_who->next = first_unknown;
first_unknown = cur_who;
break;
case WT_DEADLY:
cur_who->next = first_deadly;
first_deadly = cur_who;
break;
case WT_SKILLED:
cur_who->next = first_skilled;
first_skilled = cur_who;
break;
case WT_EXPERIENCED:
cur_who->next = first_experienced;
first_experienced = cur_who;
break;
case WT_ULTIMATE:
cur_who->next = first_ultimate;
first_ultimate = cur_who;
break;
case WT_VETERAN:
cur_who->next = first_veteran;
first_veteran = cur_who;
break;
case WT_FEARSOME:
cur_who->next = first_fearsome;
first_fearsome = cur_who;
break;
case WT_LEGENDARY:
cur_who->next = first_legendary;
first_legendary = cur_who;
break;
case WT_EPIC:
cur_who->next = first_epic;
first_epic = cur_who;
break;
case WT_ASCENDANT:
cur_who->next = first_ascendant;
first_ascendant = cur_who;
break;
case WT_TRANSCENDENT:
cur_who->next = first_transcendent;
first_transcendent = cur_who;
break;
case WT_CHAMPION:
cur_who->next = first_champion;
first_champion = cur_who;
break;
case WT_TITAN:
cur_who->next = first_titan;
first_titan = cur_who;
break;
case WT_MYTHICAL:
cur_who->next = first_mythical;
first_mythical = cur_who;
break;
case WT_OMNIPOTENT:
cur_who->next = first_omnipotent;
first_omnipotent = cur_who;
break;
case WT_DEMIGOD:
cur_who->next = first_demigod;
first_demigod = cur_who;
break;
case WT_GROUPED:
cur_who->next = first_grouped;
first_grouped = cur_who;
break;
case WT_GROUPWHO:
cur_who->next = first_groupwho;
first_groupwho = cur_who;
break;
case WT_IMM:
cur_who->next = first_imm;
first_imm = cur_who;
break;

}

}


So... there it is.. sort of. If that doesn't help too much, I can put up a link with a text file containing the entire code.. Thanks!
USA #3
I'm sure most of the errors are just because of the parse error. Since it says there is a parse error before "z", you may want to look in that area. Of course, if you havent edited anything, perhaps mud.h has some screw up where sh_int isn't defined. What are you using to compile?

To test this, I would just go looking in mud.h for sh_int. There should be a line that defines it. Also, though you will probably get errors elsewhere, try changing sh_int z to short z or short int z. Then see what the error looks like.

And for future reference, put your code in code tags so its easier to read here on the forum :P
USA #4
Also, if mud.h doesn't have a define for sh_int, you can change


 sh_int z = get_aura(victim);


to


 short z = get_aura(victim);


and it will work just fine.
#5
Now it says parse error before 'short'.. Arg. :/
#6
What comes immediately before that line?
#7
This does...

void show_visible_affects_to_char( CHAR_DATA *victim, CHAR_DATA *ch )
{
	char buf[MAX_STRING_LENGTH];
	char name[MAX_STRING_LENGTH];

	if ( IS_NPC( victim ) )
		strcpy( name, victim->short_descr );
	else
		strcpy( name, victim->name);
	name[0] = toupper(name[0]);
USA #8
Could you show us the exact error, and the full function, while having the line numbers labeled? I don't see anything wrong with that partial function.