23 Nov, 2008, Ssolvarain wrote in the 1st comment:
Votes: 0
So, I make and the compiler stops on the const.c file of QuickMUD with:

const.c:28:9: macro names must be identifiers
const.c:77: error: `OBJ_VNUM_CUSTOM_SWORD' undeclared here (not in a function)
const.c:77: error: initializer element is not constant
const.c:77: error: (near initialization for `weapon_table[0].vnum')
const.c:77: error: initializer element is not constant
const.c:77: error: (near initialization for `weapon_table[0]')
const.c:78: error: `OBJ_VNUM_CUSTOM_MACE' undeclared here (not in a function)
const.c:78: error: initializer element is not constant
const.c:78: error: (near initialization for `weapon_table[1].vnum')
const.c:78: error: initializer element is not constant
const.c:78: error: (near initialization for `weapon_table[1]')
const.c:79: error: `OBJ_VNUM_CUSTOM_DAGGER' undeclared here (not in a function)
const.c:79: error: initializer element is not constant
const.c:79: error: (near initialization for `weapon_table[2].vnum')
const.c:79: error: initializer element is not constant
const.c:79: error: (near initialization for `weapon_table[2]')
const.c:80: error: `OBJ_VNUM_CUSTOM_AXE' undeclared here (not in a function)
const.c:80: error: initializer element is not constant
const.c:80: error: (near initialization for `weapon_table[3].vnum')
const.c:80: error: initializer element is not constant
const.c:80: error: (near initialization for `weapon_table[3]')
const.c:81: error: `OBJ_VNUM_CUSTOM_STAFF' undeclared here (not in a function)
const.c:81: error: initializer element is not constant
const.c:81: error: (near initialization for `weapon_table[4].vnum')
const.c:81: error: initializer element is not constant
const.c:81: error: (near initialization for `weapon_table[4]')
const.c:82: error: `OBJ_VNUM_CUSTOM_FLAIL' undeclared here (not in a function)
const.c:82: error: initializer element is not constant
const.c:82: error: (near initialization for `weapon_table[5].vnum')
const.c:82: error: initializer element is not constant
const.c:82: error: (near initialization for `weapon_table[5]')
const.c:83: error: `OBJ_VNUM_CUSTOM_WHIP' undeclared here (not in a function)
const.c:83: error: initializer element is not constant
const.c:83: error: (near initialization for `weapon_table[6].vnum')
const.c:83: error: initializer element is not constant
const.c:83: error: (near initialization for `weapon_table[6]')
const.c:84: error: `OBJ_VNUM_CUSTOM_POLEARM' undeclared here (not in a function)
const.c:84: error: initializer element is not constant
const.c:84: error: (near initialization for `weapon_table[7].vnum')
const.c:84: error: initializer element is not constant
const.c:84: error: (near initialization for `weapon_table[7]')
const.c:85: error: initializer element is not constant
const.c:85: error: (near initialization for `weapon_table[8]')
make: *** [obj/const.o] Error 1



The lines in question are:

#define "customize.h"


const struct weapon_type weapon_table[] = {
{"sword", OBJ_VNUM_CUSTOM_SWORD, WEAPON_SWORD, &gsn_sword},
{"mace", OBJ_VNUM_CUSTOM_MACE, WEAPON_MACE, &gsn_mace},
{"dagger", OBJ_VNUM_CUSTOM_DAGGER, WEAPON_DAGGER, &gsn_dagger},
{"axe", OBJ_VNUM_CUSTOM_AXE, WEAPON_AXE, &gsn_axe},
{"staff", OBJ_VNUM_CUSTOM_STAFF, WEAPON_SPEAR, &gsn_spear},
{"flail", OBJ_VNUM_CUSTOM_FLAIL, WEAPON_FLAIL, &gsn_flail},
{"whip", OBJ_VNUM_CUSTOM_WHIP, WEAPON_WHIP, &gsn_whip},
{"polearm", OBJ_VNUM_CUSTOM_POLEARM, WEAPON_POLEARM, &gsn_polearm},
{NULL, 0, 0, NULL}
};


I know they are defined in customized.h, so I think I'm goofing something up somewhere.
23 Nov, 2008, Zeno wrote in the 2nd comment:
Votes: 0
Shouldn't you be including customize.h and not defining?
23 Nov, 2008, Ssolvarain wrote in the 3rd comment:
Votes: 0
Err, yeah. fixed that, but it's still giving me the same compiler errors. I checked customize.h and each of those has been defined…

So when it says
…undeclared here (not in a function)

What does that mean?
23 Nov, 2008, Zeno wrote in the 4th comment:
Votes: 0
Show us a few lines of it from customize.h?
23 Nov, 2008, Ssolvarain wrote in the 5th comment:
Votes: 0
Actually, I made a made a typo (or nine) in the customize.h file. I had altered it to OBJ_VNUM_SCHOOL_* to see what would happen, forgot to change it back to match what I had changed in const.c

(future reference to myself)
That compiler error was basically telling me that it was NOT defined properly in the function included, despite what my meatbag head decided.
23 Nov, 2008, David Haley wrote in the 6th comment:
Votes: 0
In general, the compiler is (almost) Always Right. :wink:
23 Nov, 2008, Ssolvarain wrote in the 7th comment:
Votes: 0
The sheer amount of errors that can come from a single out of place character can be quite alarming!
23 Nov, 2008, Andrik wrote in the 8th comment:
Votes: 0
DavidHaley said:
In general, the compiler is (almost) Always Right. :wink:


In general, the compiler is always an arsehole. :)
23 Nov, 2008, The_Fury wrote in the 9th comment:
Votes: 0
I think that i am going to enjoy reading this thread, with meatbag heads and compilers being arseholes and the like, its a good giggle first thing in the morning. Keep up the good work Ssolvarain.
23 Nov, 2008, Hades_Kane wrote in the 10th comment:
Votes: 0
Ssolvarain said:
The sheer amount of errors that can come from a single out of place character can be quite alarming!


That's one of the first and most useful things you can come to understand :p

Sometimes a misplaced ; or forgetting a ) will make it look like you've messed something up so bad you think you'd never get it fixed.
23 Nov, 2008, Ssolvarain wrote in the 11th comment:
Votes: 0
What does || do, exactly? I'm seeing that it only comes after an if check. I could hazard a guess that it means "or" or "and".
23 Nov, 2008, Zeno wrote in the 12th comment:
Votes: 0
Or.
24 Nov, 2008, The_Fury wrote in the 13th comment:
Votes: 0
Ssolvarain said:
What does || do, exactly? I'm seeing that it only comes after an if check. I could hazard a guess that it means "or" or "and".


|| or, && and, donkey ee or, == is equal to, != does not equal, ! is not, = set variable to this value, its like a language all of its own.
24 Nov, 2008, Ssolvarain wrote in the 14th comment:
Votes: 0
Aye, I understand != and so on. The || threw me off a bit.

And… donkey? o_0
24 Nov, 2008, The_Fury wrote in the 15th comment:
Votes: 0
Ssolvarain said:
Aye, I understand != and so on. The || threw me off a bit.

And… donkey? o_0


LOL i thought it was funny at the time as there is no "and or" so an ee or was the best i could do.
27 Nov, 2008, Ssolvarain wrote in the 16th comment:
Votes: 0
Someone suggested I tinker with who and score, but I'm having a few issues understanding it. I've found the do_who function in lookup.c, but I get the feeling this isn't quite what I'm looking for. Or it is, but I'm just being nubbish about it. Any tips?
27 Nov, 2008, Zeno wrote in the 17th comment:
Votes: 0
I would suggest starting with score instead, as it is a lot more straight forward.
27 Nov, 2008, Ssolvarain wrote in the 18th comment:
Votes: 0
Yeah, that was the one first suggested, which I should have stuck with. Wish I had a faster way to look through all these files rather than manually search through them.
27 Nov, 2008, Zeno wrote in the 19th comment:
Votes: 0
Using *nix? Use grep.

grep do_score *.[ch]
27 Nov, 2008, Igabod wrote in the 20th comment:
Votes: 0
or grep do_score *.* works, i don't know what the [ch] part does for grep but *.* searches all files in the directory you are currently in that have a suffix, even the ones like Makefile.Linux and README.first etc. or if you know it's in a .c file just grep do_score *.c and that'll narrow down your results to the ones you want. and the do_score function i belive is in act_info.c file in most diku based muds.
0.0/42