waaraawa / Homekit_AQI_Desk

ESP8266 Arduino source code for Apple Homekit Air Quality accessory on the desktop
https://github.com/waaraawa/Homekit_AQI_Desk/projects/2
1 stars 0 forks source link

Compile problems #1

Open georgeHayRiv opened 1 year ago

georgeHayRiv commented 1 year ago

When trying to compile this code I am getting four variables with "multiple definition of ". The problem (in Red) sections from the Arduino error messages are listed below. Both the main sketch and homekit_config.c include the homekit_config.h file. It should not get loaded by both but appears to be doing that. Could the "#ifndef HOMEKIT_CONFIGH99D20943_B47B_45CD_AF23_FF497B9150D8" line not be working?

I have tried the Wemos D1 mini and NodeMCU boards. The Arduino IDE also required for the folder name to match the name of the .ino sketch name. I have tried moving lines 44-47 in homekit_config.h into different files without success. Any suggestions?

/var/folders/q8/ld8hb0dj2074pkp69s2v65z40000gn/T/arduino_build_365515/sketch/esp8266_homekit_github.ino.cpp.o:/Users/george/Downloads/Homekit_AQI_Desk-master/esp8266_homekit_github/homekit_config.h:44: multiple definition of current_heating_cooling_state'; /var/folders/q8/ld8hb0dj2074pkp69s2v65z40000gn/T/arduino_build_365515/sketch/homekit_config.c.o:/Users/george/Downloads/Homekit_AQI_Desk-master/esp8266_homekit_github/homekit_config.h:44: first defined here /Users/george/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /var/folders/q8/ld8hb0dj2074pkp69s2v65z40000gn/T/arduino_build_365515/sketch/esp8266_homekit_github.ino.cpp.o:/Users/george/Downloads/Homekit_AQI_Desk-master/esp8266_homekit_github/homekit_config.h:45: multiple definition oftarget_heating_cooling_state'; /var/folders/q8/ld8hb0dj2074pkp69s2v65z40000gn/T/arduino_build_365515/sketch/homekit_config.c.o:/Users/george/Downloads/Homekit_AQI_Desk-master/esp8266_homekit_github/homekit_config.h:45: first defined here /Users/george/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /var/folders/q8/ld8hb0dj2074pkp69s2v65z40000gn/T/arduino_build_365515/sketch/esp8266_homekit_github.ino.cpp.o:/Users/george/Downloads/Homekit_AQI_Desk-master/esp8266_homekit_github/homekit_config.h:46: multiple definition of target_temperature'; /var/folders/q8/ld8hb0dj2074pkp69s2v65z40000gn/T/arduino_build_365515/sketch/homekit_config.c.o:/Users/george/Downloads/Homekit_AQI_Desk-master/esp8266_homekit_github/homekit_config.h:46: first defined here /Users/george/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /var/folders/q8/ld8hb0dj2074pkp69s2v65z40000gn/T/arduino_build_365515/sketch/esp8266_homekit_github.ino.cpp.o:/Users/george/Downloads/Homekit_AQI_Desk-master/esp8266_homekit_github/homekit_config.h:47: multiple definition oftemperature_display_unit'; /var/folders/q8/ld8hb0dj2074pkp69s2v65z40000gn/T/arduino_build_365515/sketch/homekit_config.c.o:/Users/george/Downloads/Homekit_AQI_Desk-master/esp8266_homekit_github/homekit_config.h:47: first defined here

georgeHayRiv commented 1 year ago

I was able to pull out just the HomeKit code and add it to a different Arduino sketch and get it to work. I never did figure out the compilation problem with the code as it is.