arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.03k stars 4.78k forks source link

Building with IR flags in user_config_override.h for tasmota32c6 gives linker error #22213

Open jeremyherbert opened 3 days ago

jeremyherbert commented 3 days ago

PROBLEM DESCRIPTION

When trying to build tasmota32c6 with IRSend support, I get a linker error.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:
 N/A
- [ ] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
  Console output here:
N.A

TO REPRODUCE

Steps to reproduce the behavior:

Edit user_config_override.h to include the following items at the bottom (above the #endif):

#define USE_IR_REMOTE
#define USE_IR_RECEIVE
#define USE_IR_REMOTE_FULL
#define _IR_ENABLE_DEFAULT_ true

Run platformio run -e tasmota32c6 and get the linker error:

...

/root/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /tmp/cccj7M58.ltrans5.ltrans.o: in function `.L0 ':
/root/tasmota/Tasmota/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino:216:(.text+0x36d2): undefined reference to `IRsend::sendGC(unsigned short*, unsigned short)'
/root/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /root/tasmota/Tasmota/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino:412:(.text+0x3830): undefined reference to `IRsend::sendRaw(unsigned short const*, unsigned short, unsigned short)'
/root/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /tmp/cccj7M58.ltrans5.ltrans.o: in function `.L0 ':
/root/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.cpp:529:(.text+0x392c): undefined reference to `IRsend::sendRaw(unsigned short const*, unsigned short, unsigned short)'
/root/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /tmp/cccj7M58.ltrans5.ltrans.o: in function `CmndIrSend()':
/root/tasmota/Tasmota/tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino:919:(.text+0x3a2a): undefined reference to `IRsend::sendRaw(unsigned short const*, unsigned short, unsigned short)'
collect2: error: ld returned 1 exit status
*** [.pio/build/tasmota32c6/firmware.elf] Error 1

EXPECTED BEHAVIOUR

There should not be a linker error. To fix the issue, I removed the defines from user_config_override.h and added the defines as build flags to platformio_tasmota32.ini:

-DUSE_IR_REMOTE
-DUSE_IR_RECEIVE
-DUSE_IR_REMOTE_FULL
-D_IR_ENABLE_DEFAULT=true

Then there is no linker error and everything works fine.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)