Servo.h not working

Hi,

i am currently trying to control a servo over Servo.h, but i always get the error 'Servo' does not name a type. Heres the Code:

// Arduino for Nerf by Marc Ruhl
// Version 1.0.0 Patch 1

#include <Servo.h>

// Configuration

const String Blaster_Name = "Nerf Stryfe";

const int ESC_1_Pin = 5;
const int ESC_2_Pin = 6;
int OUTPUT_ESC_1;
int OUTPUT_ESC_2;

const int Buzzer_1_Pin = 9;
const int Buzzer_2_Pin = 10;
int OUTPUT_Buzzer_1;
int OUTPUT_Buzzer_2;

const int Aux_1_Pin = 11;
const int Aux_2_Pin = 12;
int OUTPUT_Aux_1;
int OUTPUT_Aux_2;

const byte Potentiometer_1_Pin = A0;
const byte Potentiometer_2_Pin = A1;
int INPUT_Potentiometer_1;
int INPUT_Potentiometer_2;

const byte Switch_1_Pin = A2;
const byte Switch_2_Pin = A3;
int INPUT_Switch_1;
int INPUT_Switch_2;

const byte Magazin_In_Pin = A4;
int INPUT_Magazin_In;

const byte Jam_Door_Pin = A5;
int INPUT_Jam_Door;

const byte Trigger_Pin = A6;
int INPUT_Trigger;


const int Serial_Baudrate = 9600;

const int Min_Motor_PWM = 1000;
const int Max_Motor_PWM = 2000;
int Idle_Motor_PWM = 1200; 

const int Min_Aux_1_PWM = 1000;
const int Max_Aux_1_PWM = 2000;

const int Min_Aux_2_PWM = 1000;
const int Max_Aux_2_PWM = 2000;

const int ESC_1_2_Boot_Time = 10000;

// End of the configuration
// Text configuration

const String Serial_Connected_Message = "Serial connection established at Baud Rate:";

const String Configuring_Pins_Message = "Pins are being configured. Please wait...";
const String Configuring_Pins_Finished_Message = "Pin configuration completed.";

const String Current_Software_Configuration_Message = "Current software configuration values:";
const String End_Software_Configuration_Message = "End of the configuration.";

const String Playing_Startup_Sound_Message = "Playing startup sound...";
const String Played_Startup_Sound_Message = "Startup sound played.";

const String Waiting_ESC_Boot_Message = "Waiting for ESC(s) to boot...";
const String Waiting_ESC_Finished_Message = "Finished waiting for ESC boot. If it didnt boot, please up ESC_1_2_Boot_Time and check ESC.";

const String Setup_Finished_Message = "Setup completed. The Nerf will now go into Idle mode";

// End of Text configuration
// Setup

Servo Servoh;
Servo Servob;

Servoh.attach(5);
Servob.attach(6);

void setup() {
  Serial.begin(Serial_Baudrate);
  
  Serial.println(Serial_Connected_Message);
  Serial.println(Serial_Baudrate);
  
  Serial.println(Configuring_Pins_Message);
  
  pinMode(Buzzer_1_Pin, OUTPUT);
  pinMode(Buzzer_2_Pin, OUTPUT);
  pinMode(Aux_1_Pin, OUTPUT);
  pinMode(Aux_2_Pin, OUTPUT);
  
  pinMode(Potentiometer_1_Pin, INPUT);
  pinMode(Potentiometer_2_Pin, INPUT);
  pinMode(Switch_1_Pin, INPUT);
  pinMode(Switch_2_Pin, INPUT);
  pinMode(Magazin_In_Pin, INPUT);
  pinMode(Jam_Door_Pin, INPUT);
  pinMode(Trigger_Pin, INPUT);

  pinMode(LED_BUILTIN, OUTPUT);
  
  Serial.println(Configuring_Pins_Finished_Message);
  
  Serial.println(Current_Software_Configuration_Message);
  
  Serial.println("Blaster Name:");
  Serial.println(Blaster_Name);
  
  Serial.println("ESC 1 Pin:");
  Serial.println(ESC_1_Pin);
  Serial.println("ESC 2 Pin:");
  Serial.println(ESC_2_Pin);
  
  Serial.println("Buzzer 1 Pin:");
  Serial.println(Buzzer_1_Pin);
  Serial.println("Buzzer 2 Pin:");
  Serial.println(Buzzer_2_Pin);
  
  Serial.println("Aux 1 Pin:");
  Serial.println(Aux_1_Pin);
  Serial.println("Aux 2 Pin:");
  Serial.println(Aux_2_Pin);
  
  Serial.println("Potentiometer 1 Pin:");
  Serial.print(F("A"));
  Serial.println((int) (Potentiometer_1_Pin - A0));
  Serial.println("Potentiometer 2 Pin:");
  Serial.print(F("A"));
  Serial.println((int) (Potentiometer_2_Pin - A0));
  
  Serial.println("Switch 1 Pin:");
  Serial.print(F("A"));
  Serial.println((int) (Switch_1_Pin - A0));
  Serial.println("Switch 2 Pin:");
  Serial.print(F("A"));
  Serial.println((int) (Switch_2_Pin - A0));
  
  Serial.println("Magazin insert sensor Pin:");
  Serial.print(F("A"));
  Serial.println((int) (Magazin_In_Pin - A0));
  
  Serial.println("Jam door sensor Pin:");
  Serial.print(F("A"));
  Serial.println((int) (Jam_Door_Pin - A0));
  
  Serial.println("Trigger Pin:");
  Serial.print(F("A"));
  Serial.println((int) (Trigger_Pin - A0));
  
  Serial.println("Serial Baudrate:");
  Serial.println(Serial_Baudrate);
  Serial.println("Max. motor PWM frequency:");
  Serial.println(Max_Motor_PWM);
  Serial.println("Min. motor PWM frequency:");
  Serial.println(Min_Motor_PWM);
  Serial.println("Idle motor PWM frequency:");
  Serial.println(Idle_Motor_PWM);
  Serial.println("Min. aux 1 PWM frequency:");
  
  Serial.println(Min_Aux_1_PWM);
  Serial.println("Max. aux 1 PWM frequency:");
  Serial.println(Max_Aux_1_PWM);  
  Serial.println("Min. aux 2 PWM frequency:");
  Serial.println(Min_Aux_2_PWM);
  Serial.println("Max. aux 2 PWM frequency:");
  Serial.println(Max_Aux_2_PWM);  
  
  Serial.println(End_Software_Configuration_Message);
  
  Serial.println(Playing_Startup_Sound_Message);
  
  tone(Buzzer_1_Pin, 1000);
  tone(Buzzer_2_Pin, 1000);
  
  delay(500);
  
  noTone(Buzzer_1_Pin);
  noTone(Buzzer_2_Pin);
  
  delay(100);
  
  tone(Buzzer_1_Pin, 2000);
  tone(Buzzer_2_Pin, 2000);
  
  delay(500);
  
  noTone(Buzzer_1_Pin);
  noTone(Buzzer_2_Pin);
  
  delay(100);
  
  tone(Buzzer_1_Pin, 3000);
  tone(Buzzer_2_Pin, 3000);
  
  delay(500);
  
  noTone(Buzzer_1_Pin);
  noTone(Buzzer_2_Pin);
  
  Serial.println(Played_Startup_Sound_Message);

  ESC_1.writeMicroseconds(Min_Motor_PWM);
  ESC_2.writeMicroseconds(Min_Motor_PWM);
  
  Serial.println(Waiting_ESC_Boot_Message);
  
  delay(ESC_1_2_Boot_Time);
  
  Serial.println(Waiting_ESC_Finished_Message);

  digitalWrite(LED_BUILTIN, LOW);
  
  Serial.println(Setup_Finished_Message);
}

// End of setup
// Loop

void loop() {

  // Reading inputs
  
  INPUT_Potentiometer_1 = analogRead(Potentiometer_1_Pin);
  INPUT_Potentiometer_2 = analogRead(Potentiometer_2_Pin);
  
  INPUT_Switch_1 = analogRead(Switch_1_Pin);
  INPUT_Switch_2 = analogRead(Switch_1_Pin);

  INPUT_Magazin_In = analogRead(Magazin_In_Pin);

  INPUT_Jam_Door = analogRead(Jam_Door_Pin);

  INPUT_Trigger = analogRead(Trigger_Pin);

  // End of reading inputs
  // Calculating outputs

  if (INPUT_Switch_1 == 1023) {

    digitalWrite(LED_BUILTIN, HIGH);
    if (INPUT_Magazin_In == 1023) {
      if (INPUT_Jam_Door == 1023) {
        ESC_1.writeMicroseconds(Idle_Motor_PWM);
        ESC_2.writeMicroseconds(Idle_Motor_PWM);
      }
    }
    if (INPUT_Trigger == 1023) {
      if (INPUT_Jam_Door == 1023) {
        if (INPUT_Mazin_In == 1023) {
          ESC_1_.writeMicroseconds(Max_Motor_PWM);
          ESC_2.writeMicroseconds(Max_Motor_PWM);
        }
      }
    }
    else {
      ESC_1.writeMicroseconds(Min_Motor_PWM);
      ESC_2.writeMicroseconds(Min_Motor_PWM);
    }
  }
  
}

And the error:

exit status 1
'Servoh' does not name a type

Any Ideas what could be wrong? I searched long, but didnt find anything that helped me...

Thank you very much.

Servoh.attach(5);
Servob.attach(6);

This executable code is not in a function (like setup()). It MUST be.

I got many more errors trying to compile that.

Moving your two servo attach lines into setup corrected some errors. But I see that you never actually use Servoh or Servob.

Later you try to use ESC_1 and ESC_2 but they have never been declared.

I suspect that meant to use references to the same set of Servo objects.