Understanding compiling error responses.

OllyR:
Maybe its just me, but it strikes me as logical, that when you get an error code back from trying to compile the sketch, ie:

The IDE adds a couple of lines to your code before the compiler gets it. However, it generally backs out number from the error before printing it in the status window.

Also, keep in mind the compiler doesn't always identify the line that is the actual problem. It is just the line where the compiler ran into a problem. This complicates the issue of identifying where the issue occurred.

OllyR:
"Turret5.cpp:50:41: error: expected identifier before ‘(’ token"

I have not seen an error message like that before. Since you have an example, you might want to post your code.