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)