Trying to Compile Code with IRremote Library, and getting errors

Hi all,
I am trying to get a IR remote from an elegoo robot car working with more hardware, I am trying to upload the code provide by Elegoo themselves with minimal modifications here is there program:

//www.elegoo.com

bool weaponActive = false

#include <IRremote.h>

////////// IR REMOTE CODES //////////
#define F 16736925	// FORWARD
#define B 16754775	// BACK
#define L 16720605	// LEFT
#define R 16761405	// RIGHT
#define S 16712445	// STOP
#define UNKNOWN_F 5316027		  // FORWARD
#define UNKNOWN_B 2747854299	// BACK
#define UNKNOWN_L 1386468383	// LEFT
#define UNKNOWN_R 553536955		// RIGHT
#define UNKNOWN_S 3622325019	// STOP
#define KEY1 16738455
#define KEY2 16750695
#define KEY3 16756815
#define KEY4 16724175
#define KEY5 16718055
#define KEY6 16743045
#define KEY7 16716015
#define KEY8 16726215
#define KEY9 16734885
#define KEY0 16730805
#define KEY_STAR 16728765
#define KEY_HASH 16732845

#define RECV_PIN  12

/*define channel enable output pins*/
#define ENA 5	  // Left  wheel speed
#define ENB 6	  // Right wheel speed
#define ENC 2   // Weapon speed
/*define logic control output pins*/
#define IN1 7	  // Left  wheel forward
#define IN2 8	  // Left  wheel reverse
#define IN3 9	  // Right wheel reverse
#define IN4 11	// Right wheel forward
#define carSpeed 250	// initial speed of car >=0 to <=255

IRrecv irrecv(RECV_PIN);
decode_results results;
unsigned long val;
unsigned long preMillis;

/**
 * BEGIN DEFINE FUNCTIONS
 */

 void forward(){ 
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  Serial.println("go forward!");
}
void back(){
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,HIGH);
  digitalWrite(IN4,LOW);
  Serial.println("go back!");
}
void left(){
  analogWrite(ENA,carSpeed);
  analogWrite(ENB,carSpeed);
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH); 
  Serial.println("go left!");
}
void right(){
  analogWrite(ENA,carSpeed);
  analogWrite(ENB,carSpeed);
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,HIGH);
  digitalWrite(IN4,LOW);
  Serial.println("go right!");
}
void weaponControl(){
  analogWrite(ENC,carSpeed);
  
}

void stop(){
  digitalWrite(ENA, LOW);
  digitalWrite(ENB, LOW);
  Serial.println("STOP!");  
}

void setup() {
  Serial.begin(9600);
  pinMode(IN1,OUTPUT);
  pinMode(IN2,OUTPUT);
  pinMode(IN3,OUTPUT);
  pinMode(IN4,OUTPUT);
  pinMode(ENA,OUTPUT);
  pinMode(ENB,OUTPUT);
  stop();
  irrecv.enableIRIn();  
}

void loop() {
  if (irrecv.decode(&results)){ 
    preMillis = millis();
    val = results.value;
    Serial.println(val);
    irrecv.resume();
    switch(val){
      case F: 
      case UNKNOWN_F: forward(); break;
      case B: 
      case UNKNOWN_B: back(); break;
      case L: 
      case UNKNOWN_L: left(); break;
      case R: 
      case UNKNOWN_R: right();break;
      case KEY0: weaponControl(); break;
      case S: 
      case UNKNOWN_S: stop(); break;
      default: break;
    }
  }
  else{
    if(millis() - preMillis > 500){
      stop();
      preMillis = millis();
    }
  }
}

I keep getting Error messages about terms not being defined (they are more then 9000 characters, so I have attached them) the terms are from IrSend.cpp.h, and are stuff like SAMSUNG and SONY

The library that it mentioned, IrRemote is v2.0, and I have tried downgrading and re-upgrading.

I’m new to Arduino, and this is really confusing me

errorMessages.txt (33.1 KB)

You are missing a semicolon:

bool weaponActive = false

ToddL1962:
You are missing a semicolon:

bool weaponActive = false

Fixed! Thank you, do you know why that caused so many problems earlier?

do you know why that caused so many problems earlier?

Because it was missing when it should have been there

I know that, I'm just wondering why the errors were with the library and not the program

modular_holmes: I know that, I'm just wondering why the errors were with the library and not the program

Because you declared weaponActive before the library include. If you declared weaponActive after the library include and left off the semicolon you would get completely different errors.

The preprocessor includes the library header and then the compiler takes over. The compiler parses the entire source file (with the library header included). Since it didn't see the semicolon (which terminate a C/C++ source statement) it can only deduce that this statement is continued on the next line (the first line in the library header). From there the errors just kind of cascade.

bool weaponActive = false

#include <IRremote.h>

Because you did not end that statement, part of IRremote.h became part of that statement and the errors snowballed from there.