I have some code that in 5 different files I include a .h file . The file contains:
#ifndef RemoteStatus_H
#define RemoteStatus_H
#include "ArduinoTimer.h"
ArduinoTimer ledONtime;
ArduinoTimer ledOFFtime;
This file is included 5 times and I get the following errors:
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLEHandler.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: multiple definition of `ledOFFtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: first defined here
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLEHandler.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: multiple definition of `ledONtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: first defined here
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/InputHandler.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: multiple definition of `ledOFFtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: first defined here
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/InputHandler.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: multiple definition of `ledONtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: first defined here
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/OAG.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: multiple definition of `ledOFFtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: first defined here
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/OAG.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: multiple definition of `ledONtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: first defined here
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/RemoteStatus.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: multiple definition of `ledOFFtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: first defined here
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/RemoteStatus.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: multiple definition of `ledONtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: first defined here
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/Sony_OAG_Focuser_RAYTAC.ino.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: multiple definition of `ledOFFtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:7: first defined here
/Users/Kurt/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/Sony_OAG_Focuser_RAYTAC.ino.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: multiple definition of `ledONtime'; /private/var/folders/2b/fgk4_0b13bl41w3jww7ndhpw0000gp/T/arduino/sketches/9926221EECF16418237CC5ACB14367E2/sketch/BLECamera.cpp.o:/Volumes/Astrophotography/Arduino 2022/Sony_OAG_Focuser_RAYTAC/RemoteStatus.h:6: first defined here
collect2: error: ld returned 1 exit status
Why is this happening to me?
Kurt