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?

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)