Error: invalid types 'int[int]' for array subscript
Take a close look at this line:

motor[1][j]-&gt;run(RELEASE);


Looks like it should be:

motor[i][j]-&gt;run(RELEASE);


Otherwise it is an illegal index (as there is only one shield). 

The next error is in the function switchMotor(). Again, have a close look at the definition of "motor". There is a local variable with that name but you want to also access the global array with the same name.

void switchMotor()
{
  int shield = currentShield - 1;
  int motor = currentMotor - 1;
      ^
  for (int i = 0; i &lt; nShields; i++) {
    for (int j = 0; j &lt; nMotorsPerShield; j++) {
      if (i == shield &amp;&amp; j == motor)
        motor[i][j]-&gt;run(FORWARD);
        ^
      else
        motor[i][j]-&gt;run(RELEASE);
    }
  }
}


My guess is that this is where the compiler give you the error message!

Cheers!