This is your full error; it indicates the line where it fails.
C:\Users\WIMSTU~1\AppData\Local\Temp\arduino_3431cf36d2090c05fd30f5c5b5b2b264\sketch_oct28a.ino: In function 'void loop()':
sketch_oct28a:50: error: 'else' without a previous 'if'
else{
^
Using library Servo at version 1.1.1 in folder: C:\Program Files (x86)\Arduino\libraries\Servo
exit status 1
'else' without a previous 'if'
The IDE even highlights the line where the error occurs. And the section of the code
if (cm > 10);{ //check left
digitalWrite(left, HIGH);
}
else{
servo.write(180); //turn to right
delay(100);
}
Looking at that part, your if statement ends with a semi-colon.
PS
Please edit your post and change the [quote] and [/quote] to [code] and [/code].