Error compiling for Board Atmega8

I have a LED toggle using CTC on timer 1 based on code below.
There is no compilation error and the code uploads on Atmega8 using Minicore.
When I add the IRremote library, the compilation gives the error of Exit Status 1
Error compiling for Board Atmega8.
At the risk of offending respected moderators of this forum I am putting up this post.
I have truncated the error message, and attached the complete file.

#include <EEPROM.h>
//#include <boarddefs.h>
#include <IRremote.h>
//#include <IRremoteInt.h>
//#include <ir_Lego_PF_BitStreamEncoder.h>

#define setbit(port, bit) (port) |= (1<< (bit))
#define clearbit(port, bit) (port) &=~(1<< (bit))

#define POWER_LED_ON() clearbit(PORTD, PD7)
#define POWER_LED_OFF() setbit(PORTD, PD7)

uint8_t table[10] = {141, 125, 109, 94, 78, 62, 47, 31, 16, 1};

const int iRReceivePin = PD2;
//IRrecv irrecv(iRReceivePin);
//decode_results results;
/* iniialise speed to zero, and also store the set value in EEPROM
  on every change to be read from it on power recycle.
*/
int speedVal = 0;
int num = 0;
uint8_t fan_on = 0;
uint8_t lastPowerState = 0;


void setup() {
  // put your setup code here, to run once:
TCCR1A = 0;
  TCCR1B = 0;
  DDRD |= (1 << PD6);//DDR for PD6
  TCCR1B |= (1 << WGM12); //Configure Timer1 for CTC
  TIMSK |= (1 << OCIE1A); // Enable CTC interrupt
  sei();
  OCR1A = 15624; // set CTC compare value to 1 Hz at 16 MHz clock and prescalar of 1024
  TCCR1B |= ((1 << CS12) | (1 << CS10));
}
ISR(TIMER1_COMPA_vect)
{
  PORTD ^= (1 << PD6); // Toggle PD6
}



void loop() {
  // put your main code here, to run repeatedly:

}
Arduino: 1.8.10 (Windows 10), Board: "ATmega8, No bootloader, BOD disabled, LTO disabled, 16 MHz external"

D:\Arduino_1.8.10\arduino-1.8.10\arduino-builder -dump-prefs -logger=machine -hardware D:\Arduino_1.8.10\arduino-1.8.10\hardware -hardware C:\Users\Karanbir\AppData\Local\Arduino15\packages -hardware D:\Arduino_1.8.10\Portable\Sketchbook\hardware -tools D:\Arduino_1.8.10\arduino-1.8.10\tools-builder -tools D:\Arduino_1.8.10\arduino-1.8.10\hardware\tools\avr -tools C:\Users\Karanbir\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino_1.8.10\arduino-1.8.10\libraries -libraries D:\Arduino_1.8.10\Portable\Sketchbook\libraries -fqbn=MiniCore:avr:8:bootloader=no_bootloader,BOD=disabled,LTO=Os,clock=16MHz_external -ide-version=10810 -build-path C:\Users\Karanbir\AppData\Local\Temp\arduino_build_78381 -warnings=all -build-cache C:\Users\Karanbir\AppData\Local\Temp\arduino_cache_921060 -prefs=build.warn_data_percentage=75 -verbose D:\Arduino_1.8.10\Portable\Sketchbook\TestingIR_Toggle\TestingIR_Toggle.ino
D:\Arduino_1.8.10\arduino-1.8.10\arduino-builder -compile -logger=machine -hardware D:\Arduino_1.8.10\arduino-1.8.10\hardware -hardware C:\Users\Karanbir\AppData\Local\Arduino15\packages -hardware D:\Arduino_1.8.10\Portable\Sketchbook\hardware -tools D:\Arduino_1.8.10\arduino-1.8.10\tools-builder -tools D:\Arduino_1.8.10\arduino-1.8.10\hardware\tools\avr -tools C:\Users\Karanbir\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino_1.8.10\arduino-1.8.10\libraries -libraries D:\Arduino_1.8.10\Portable\Sketchbook\libraries -fqbn=MiniCore:avr:8:bootloader=no_bootloader,BOD=disabled,LTO=Os,clock=16MHz_external -ide-version=10810 -build-path C:\Users\Karanbir\AppData\Local\Temp\arduino_build_78381 -warnings=all -build-cache C:\Users\Karanbir\AppData\Local\Temp\arduino_cache_921060 -prefs=build.warn_data_percentage=75 -verbose D:\Arduino_1.8.10\Portable\Sketchbook\TestingIR_Toggle\TestingIR_Toggle.ino
Using board '8' from platform in folder: C:\Users\Karanbir\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.3
Using core 'MCUdude_corefiles' from platform in folder: C:\Users\Karanbir\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.3
Detecting libraries used...

Compiling sketch...
"D:\\Arduino_1.8.10\\arduino-1.8.10\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_ATmega8 -DARDUINO_ARCH_AVR "-IC:\\Users\\Karanbir\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.0.3\\cores\\MCUdude_corefiles" "-IC:\\Users\\Karanbir\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.0.3\\variants\\standard" "-IC:\\Users\\Karanbir\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.0.3\\libraries\\EEPROM\\src" "-ID:\\Arduino_1.8.10\\Portable\\Sketchbook\\libraries\\IRremote" "C:\\Users\\Karanbir\\AppData\\Local\\Temp\\arduino_build_78381\\sketch\\TestingIR_Toggle.ino.cpp" -o "C:\\Users\\Karanbir\\AppData\\Local\\Temp\\arduino_build_78381\\sketch\\TestingIR_Toggle.ino.cpp.o"
In file included from D:\Arduino_1.8.10\Portable\Sketchbook\TestingIR_Toggle\TestingIR_Toggle.ino:1:0:

C:\Users\Karanbir\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.3\libraries\EEPROM\src/EEPROM.h:145:20: warning: 'EEPROM' defined but not used [-Wunused-variable]

 static EEPROMClass EEPROM;

                    ^~~~~~

Compiling libraries...
Compiling library "EEPROM"
Compiling library "IRremote"
Using previously compiled file:  "C:\\Users\\Karanbir\\AppData\\Local\\Temp\\arduino_build_78381/..\\arduino_cache_921060\\core\\core_02080db28ee246557bb4a86f962f1a7a.a" "-LC:\\Users\\Karanbir\\AppData\\Local\\Temp\\arduino_build_78381" -lm
C:\Users\Karanbir\AppData\Local\Temp\arduino_build_78381\libraries\IRremote\IRremote.cpp.o: In function `__vector_6':

D:\Arduino_1.8.10\Portable\Sketchbook\libraries\IRremote/IRremote.cpp:139: multiple definition of `__vector_6'

C:\Users\Karanbir\AppData\Local\Temp\arduino_build_78381\sketch\TestingIR_Toggle.ino.cpp.o:D:\Arduino_1.8.10\Portable\Sketchbook\TestingIR_Toggle/TestingIR_Toggle.ino:39: first defined here

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for "EEPROM.h"
 Used: C:\Users\Karanbir\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.3\libraries\EEPROM
Multiple libraries were found for "IRremote.h"
 Used: D:\Arduino_1.8.10\Portable\Sketchbook\libraries\IRremote
Using library EEPROM at version 2.0 in folder: C:\Users\Karanbir\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.3\libraries\EEPROM 
Using library IRremote at version 2.2.3 in folder: D:\Arduino_1.8.10\Portable\Sketchbook\libraries\IRremote 
exit status 1
Error compiling for board ATmega8.

error message.txt (28.4 KB)

The IR module also uses timer1. You can change that by editting IRRemoteInt.h file in the library.

blh64:
The IR module also uses timer1. You can change that by editting IRRemoteInt.h file in the library.

It uses Timer2 also.

Isn't this the same error you posted about here

Please don't do multiple posts

blh64:
Isn't this the same error you posted about [here[\url]

Please don't do multiple posts
[/quote]

Please excuse me for my mistake.
I freed up Timer 2 from the IRremote library, also commented the protocols not needed. The Timer detail was in the boarddefs.h

Now my code has compiled for Atmega8. I am putting the code beow for the complete project of triac control using zerocross detection.

Thanks to all the forum members contributing in my endeavour to complete the code. The AC control has to be verified across the triac.

#include <EEPROM.h>

#include <boarddefs.h>
#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>

#define setbit(port, bit) (port) |= (1<< (bit))
#define clearbit(port, bit) (port) &=~(1<< (bit))

#define POWER_LED_ON() clearbit(PORTD, PD7)
#define POWER_LED_OFF() setbit(PORTD, PD7)

uint8_t table[10] = {141, 125, 109, 94, 78, 62, 47, 31, 16, 1};

const int iRReceivePin = PD2;
IRrecv irrecv(iRReceivePin);
decode_results results;
/* iniialise speed to zero, and also store the set value in EEPROM
 on every change to be read from it on power recycle.
*/
int speedVal = 0;
int num = 0;
uint8_t fan_on = 0;
uint8_t lastPowerState = 0;

void setup()
{
 // put your setup code here, to run once:
 initialize(); //initialize display
//initialize zero cross
 MCUCR |= ((1 << ISC11) | (1 << ISC10)); //INT in Rising edge
 GICR |= (1 << INT1);      //Enable INT1
 //set Timer2
 TCCR2 |= (1 << WGM21); //CTC
 TIMSK |= (1 << OCIE2); //Enable OCI2
 sei();
}

//Zero Crossing Detect.
ISR(INT1_vect)
{
 if (!fan_on)
 {
   PORTD |= (1 << PD5); //High = TRIAC Off
   return;
 }
 if (9 == speedVal)
 {
   PORTD &= (~(1 << PD5)); //low = TRIAC ON
   return;
 }
 PORTD |= (1 << PD5); //High = TRIAC Off
 OCR2 = table[speedVal];
 TCNT2 = 0x00;
 TCCR2 |= ((1 << CS22) | (1 << CS21) |(1 << CS20)); // eneble presccalar of 1024
}

ISR(TIMER2_COMP_vect)
{
 PORTD &= (~(1 << PD5)); //low = TRIAC ON
 TCCR2 &= (~((1 << CS22) | (1 << CS21)) | (1 << CS10)); //Stop Timer
}

void loop()
{
 while (1)
 if (irrecv.decode(&results))
 {
   switch (results.value)
   {
     case 0xFF48B7:  // NEC code for UP Key
       {
         if (speedVal < 9)
           speedVal++;
         Display (speedVal);
         EEPROM.put(5, speedVal);
       }
       break;
     case 0XFF609F:  //NEC Code for DOWN Key
       {
         if (speedVal > 0)
           speedVal--;
         Display (speedVal);
         EEPROM.put(5, speedVal);
       }
       break;
     case 0xFFAA55:  // NEC code for enter key
       {
         if (fan_on)
         {
           POWER_LED_OFF();
           fan_on = 0;
           lastPowerState = fan_on;
           EEPROM.put (3, lastPowerState);
         }
         else
         {
           POWER_LED_ON();
           fan_on = 1;
           lastPowerState = fan_on;
           EEPROM.put (3, lastPowerState);
         }
       }
       break;
   }
   irrecv.resume(); // Receive the next value
 }
}

/* Seven Segment Display Function */

void Display(int num)
{
 if (num > 9)
   return;
 switch (num)
 {
   case 0:
     PORTC = 0B00000000;
     PORTB = 0B00000010;
     break;
   case 1:
     PORTC = 0B00111001;
     PORTB = 0B00000010;
     break;
   case 2:
     PORTC = 0B00100100;
     PORTB = 0B00000000;
     break;
   case 3:
     PORTC = 0B00110000;
     PORTB = 0B00000000;
     break;
   case 4:
     PORTC = 0B00011001;
     PORTB = 0B00000000;
     break;
   case 5:
     PORTC = 0B00010010;
     PORTB = 0B00000000;
     break;
   case 6:
     PORTC = 0B00000010;
     PORTB = 0B00000000;
     break;
   case 7:
     PORTC = 0B00111000;
     PORTB = 0B00000010;
     break;
   case 8:
     PORTC = 0B00000000;
     PORTB = 0B00000000;
     break;
   case 9:
     PORTC = 0B00010000;
     PORTB = 0B00000000;
     break;
 }
}
void initialize()
{
 irrecv.enableIRIn(); // Start the IR receiver
 /*  PD7 as output  /
 POWER_LED_OFF();
 DDRD |= (1 << PD7);
 /
Set PD2 and PD3 as inputs /
 DDRD &= ~(1 << PD2);
 DDRD &= ~(1 << PD3);
 // Port C pins 0 to 5 as output for seg a b c d e f
 // Port B pin 1 as output for segment g
 DDRC |=  (1 << PC0) | (1 << PC1) | (1 << PC2) | (1 << PC3) | (1 << PC4) | (1 << PC5);
 DDRB |= (1 << PB1);
 /
Sets all segments a to g in the display off /
 setbit (PORTC, PC0);
 setbit (PORTC, PC1);
 setbit (PORTC, PC2);
 setbit (PORTC, PC3);
 setbit (PORTC, PC4);
 setbit (PORTC, PC5);
 setbit (PORTB, PB1);
 EEPROM.get (5, speedVal);
 Display (speedVal);
 EEPROM.get (3, lastPowerState);
 fan_on = lastPowerState;
 if (lastPowerState)
 {
   POWER_LED_ON();
 }
 else
 {
   POWER_LED_OFF();
 }
 /
 Output - blocking gate signal to opto isolator */
 setbit(PORTD, PD5); //PD5 High = Triac off
 DDRD |= (1 << PD5); //set DDR for port BIT 5
}



](https://forum.arduino.cc/index.php?topic=651850.0)