Exit status 1 'calculateSum' was not declared in this scope

That last line is in a loop....