You are getting those errors because you are trying to declare an array size with a non constant value/uncomplete memory address of the var, declaring an array size should be done with pre defined size so the compiler would know what size it should be assigned for.
Note:
Also declaring global array variables should always be in the first of the script and thier sizes before them