Error compiling for board Arduino/Genuino Uno.

Hello, I purchased a arduino uno board a couple of days ago and i got a good start on it, but I run across an issue where the code cant compile for the arduino uno that I am using, I am trying to make a IR sensor react to an IR remote and show up on the serial monitor, can someone please help me look over my code? Thanks!

//www.elegoo.com
//2016.12.9

#include "IRremote.h"

int receiver = 11; // Signal Pin of IR receiver to Arduino Digital Pin 11

/*-----( Declare objects )-----*/
IRrecv irrecv(receiver);     // create instance of 'irrecv'
decode_results results;      // create instance of 'decode_results'

/*-----( Function )-----*/
void translateIR() // takes action based on IR code received

// describing Remote IR codes 

{

  switch(results.value)

  {
  case 0xFFA25D: Serial.println("POWER"); break;
  case 0xFFE21D: Serial.println("FUNC/STOP"); break;
  case 0xFF629D: Serial.println("VOL+"); break;
  case 0xFF22DD: Serial.println("FAST BACK");    break;
  case 0xFF02FD: Serial.println("PAUSE");    break;
  case 0xFFC23D: Serial.println("FAST FORWARD");   break;
  case 0xFFE01F: Serial.println("DOWN");    break;
  case 0xFFA857: Serial.println("VOL-");    break;
  case 0xFF906F: Serial.println("UP");    break;
  case 0xFF9867: Serial.println("EQ");    break;
  case 0xFFB04F: Serial.println("ST/REPT");    break;
  case 0xFF6897: Serial.println("0");    break;
  case 0xFF30CF: Serial.println("1");    break;
  case 0xFF18E7: Serial.println("2");    break;
  case 0xFF7A85: Serial.println("3");    break;
  case 0xFF10EF: Serial.println("4");    break;
  case 0xFF38C7: Serial.println("5");    break;
  case 0xFF5AA5: Serial.println("6");    break;
  case 0xFF42BD: Serial.println("7");    break;
  case 0xFF4AB5: Serial.println("8");    break;
  case 0xFF52AD: Serial.println("9");    break;
  case 0xFFFFFFFF: Serial.println(" REPEAT");break;  

  default: 
    Serial.println(" other button   ");

  }// End Case

  delay(500); // Do not get immediate repeat


} //END translateIR
void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  Serial.begin(9600);
  Serial.println("IR Receiver Button Decode"); 
  irrecv.enableIRIn(); // Start the receiver

}/*--(end setup )---*/


void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
  if (irrecv.decode(&results)) // have we received an IR signal?

  {
    translateIR(); 
    irrecv.resume(); // receive the next value
  }  
}/* --(end main loop )-- */

and for the Irremote.h file:

/*
 * IRremote
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.htm http://arcfn.com
 * Edited by Mitra to add new controller SANYO
 *
 * Interrupt code based on NECIRrcv by Joe Knapp
 * http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556
 * Also influenced by http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/
 *
 * JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)
* LG added by Darryl Smith (based on the JVC protocol)
 */

#ifndef IRremote_h
#define IRremote_h

// The following are compile-time library options.
// If you change them, recompile the library.
// If DEBUG is defined, a lot of debugging output will be printed during decoding.
// TEST must be defined for the IRtest unittests to work.  It will make some
// methods virtual, which will be slightly slower, which is why it is optional.
// #define DEBUG
// #define TEST

// Results returned from the decoder
class decode_results {
public:
  int decode_type; // NEC, SONY, RC5, UNKNOWN
  union { // This is used for decoding Panasonic and Sharp data
    unsigned int panasonicAddress;
    unsigned int sharpAddress;
  };
  unsigned long value; // Decoded value
  int bits; // Number of bits in decoded value
  volatile unsigned int *rawbuf; // Raw intervals in .5 us ticks
  int rawlen; // Number of records in rawbuf.
};

// Values for decode_type
#define NEC 1
#define SONY 2
#define RC5 3
#define RC6 4
#define DISH 5
#define SHARP 6
#define PANASONIC 7
#define JVC 8
#define SANYO 9
#define MITSUBISHI 10
#define SAMSUNG 11
#define LG 12
#define UNKNOWN -1

// Decoded value for NEC when a repeat code is received
#define REPEAT 0xffffffff

// main class for receiving IR
class IRrecv
{
public:
  IRrecv(int recvpin);
  void blink13(int blinkflag);
  int decode(decode_results *results);
  void enableIRIn();
  void resume();
private:
  // These are called by decode
  int getRClevel(decode_results *results, int *offset, int *used, int t1);
  long decodeNEC(decode_results *results);
  long decodeSony(decode_results *results);
  long decodeSanyo(decode_results *results);
  long decodeMitsubishi(decode_results *results);
  long decodeRC5(decode_results *results);
  long decodeRC6(decode_results *results);
  long decodePanasonic(decode_results *results);
  long decodeLG(decode_results *results);
  long decodeJVC(decode_results *results);
  long decodeSAMSUNG(decode_results *results);
  long decodeHash(decode_results *results);
  int compare(unsigned int oldval, unsigned int newval);

} 
;

// Only used for testing; can remove virtual for shorter code
#ifdef TEST
#define VIRTUAL virtual
#else
#define VIRTUAL
#endif

class IRsend
{
public:
  IRsend() {}
  void sendNEC(unsigned long data, int nbits);
  void sendSony(unsigned long data, int nbits);
  // Neither Sanyo nor Mitsubishi send is implemented yet
  //  void sendSanyo(unsigned long data, int nbits);
  //  void sendMitsubishi(unsigned long data, int nbits);
  void sendRaw(unsigned int buf[], int len, int hz);
  void sendRC5(unsigned long data, int nbits);
  void sendRC6(unsigned long data, int nbits);
  void sendDISH(unsigned long data, int nbits);
  void sendSharp(unsigned int address, unsigned int command);
  void sendSharpRaw(unsigned long data, int nbits);
  void sendPanasonic(unsigned int address, unsigned long data);
  void sendJVC(unsigned long data, int nbits, int repeat); // *Note instead of sending the REPEAT constant if you want the JVC repeat signal sent, send the original code value and change the repeat argument from 0 to 1. JVC protocol repeats by skipping the header NOT by sending a separate code value like NEC does.
  // private:
  void sendSAMSUNG(unsigned long data, int nbits);
  void enableIROut(int khz);
  VIRTUAL void mark(int usec);
  VIRTUAL void space(int usec);
}
;

// Some useful constants

#define USECPERTICK 50  // microseconds per clock interrupt tick
#define RAWBUF 100 // Length of raw duration buffer

// Marks tend to be 100us too long, and spaces 100us too short
// when received due to sensor lag.
#define MARK_EXCESS 100

#endif

If it helps at all here is the exact error message:

Arduino: 1.8.7 (Windows Store 1.8.15.0) (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\Caiden\AppData\Local\Temp\ccNln9Aa.ltrans0.ltrans.o: In function `__static_initialization_and_destruction_0':

C:\Users\Caiden\AppData\Local\Temp\Temp9_Elegoo The Most Complete Starter Kit for UNO V1.0.2018.09.20 (1).zip\Elegoo The Most Complete Starter Kit for UNO V1.0.2018.09.20\English\code\Lesson 14 IR Receiver Module\IR_Receiver_Module/IR_Receiver_Module.ino:9: undefined reference to `IRrecv::IRrecv(int)'

C:\Users\Caiden\AppData\Local\Temp\ccNln9Aa.ltrans0.ltrans.o: In function `setup':

C:\Users\Caiden\AppData\Local\Temp\Temp9_Elegoo The Most Complete Starter Kit for UNO V1.0.2018.09.20 (1).zip\Elegoo The Most Complete Starter Kit for UNO V1.0.2018.09.20\English\code\Lesson 14 IR Receiver Module\IR_Receiver_Module/IR_Receiver_Module.ino:58: undefined reference to `IRrecv::enableIRIn()'

C:\Users\Caiden\AppData\Local\Temp\ccNln9Aa.ltrans0.ltrans.o: In function `loop':

C:\Users\Caiden\AppData\Local\Temp\Temp9_Elegoo The Most Complete Starter Kit for UNO V1.0.2018.09.20 (1).zip\Elegoo The Most Complete Starter Kit for UNO V1.0.2018.09.20\English\code\Lesson 14 IR Receiver Module\IR_Receiver_Module/IR_Receiver_Module.ino:65: undefined reference to `IRrecv::decode(decode_results*)'

C:\Users\Caiden\AppData\Local\Temp\Temp9_Elegoo The Most Complete Starter Kit for UNO V1.0.2018.09.20 (1).zip\Elegoo The Most Complete Starter Kit for UNO V1.0.2018.09.20\English\code\Lesson 14 IR Receiver Module\IR_Receiver_Module/IR_Receiver_Module.ino:69: undefined reference to `IRrecv::resume()'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I copied your code into the Arduino Create Editor ( online tools ) ....and it compiles well !

See here :

Have you declared the right Board ?

Otherwise check your Arduino Tools installation

or

simply use the online tools, you can Verify and Upload with the online tools... 8)

It says its using the Genuino uno and com3, and it still wont upload, should I not be putting a .h file as an extra tab next to the main sketch?

CaidenM:
It says its using the Genuino uno and com3, and it still wont upload, should I not be putting a .h file as an extra tab next to the main sketch?

do not put the H file as an extra tab for sure. Also, turn on verbose in preferences to see more information.

You need to install the complete IRremote library, not paste the library's .h file into your sketch. Delete the IRremote.h tab from your sketch and then install the library:

  • Sketch > Include Library > Manage Libraries...
  • Wait for download to finish.
  • In the "Filter your search..." input field, type "IRremote".
  • Click on "IRremote by shirriff".
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".