matthias-bs / BresserWeatherSensorTTN

Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver based on ESP32 and RFM95W/SX1276 - sends data to a LoRaWAN Network (e.g. The Things Network)
MIT License
22 stars 9 forks source link

Linker error with v2.0.x of Arduino core for the ESP32 #6

Closed matthias-bs closed 1 year ago

matthias-bs commented 1 year ago

There is a naming conflict between MCCI_LoRaWAN_LMIC_library and Arduino core for the ESP32. The symbol hal_init is defined twice which causes a linker error. As a workaraound, v1.0.6 of the Arduino core for ESP32 must be used.

/home/runner/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.4/tools/sdk/esp32/lib/libpp.a(hal_mac.o): in function `hal_init':
(.text.hal_init+0xb4): multiple definition of `hal_init'; /tmp/arduino-sketch-3B10729107F9600CD77F61B8D0ED78E7/libraries/MCCI_LoRaWAN_LMIC_library/hal/hal.cpp.o:/home/runner/Arduino/libraries/MCCI_LoRaWAN_LMIC_library/src/hal/hal.cpp:416: first defined here
collect2: error: ld returned 1 exit status

Error during build: exit status 1
matthias-bs commented 1 year ago

This is a known issue: https://github.com/mcci-catena/arduino-lmic/issues/714

matthias-bs commented 1 year ago

See https://github.com/mcci-catena/arduino-lmic/issues/714#issuecomment-822051171 for a fix.