That was just part of the code, most of which I'm afraid might be unnecessary, since the error is as follows:
gameidea\program.h(44) : error C2601: 'function' : local function definitions are illegal
Can anyone figure it out?
And which line in header line 44 relates to? because it looks like you omitted some parts
EDIT: looks like you forgot to close brace on some of previous lines
It means that 'function' is inside another function. This probably means that you forgot a brace } somewhere before 'function' definition (maybe in one of the files you included - the error might be there)