cesanta / mDash

Arduino / ESP-IDF library for mdash.net IoT service
https://mdash.net
Other
34 stars 17 forks source link

Failed to compile (collect issue) with latest ESP32 core (undefined reference to `mDashInit') #15

Closed 0x0fe closed 2 years ago

0x0fe commented 2 years ago
  1. Find Arduino's esp32 plaform.txt file and change it like in PR4209
  2. Find library.properties file in the installed mDash library, and remove line ldflags=-lmDash
  3. Restart Arduino IDE

Originally posted by @cpq in https://github.com/cesanta/mDash/issues/8#issuecomment-686294059

So these steps have been followed, adapting since plastform.txt has changed, IDE restarted, but the issue persists.

## Combine gc-sections, archives, and objects
## recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-Wl,--Map={build.path}/{build.project_name}.map" "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf"
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-Wl,--Map={build.path}/{build.project_name}.map" "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} {compiler.libraries.ldflags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf"
c:/users/xx/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/gcc8_4_0-esp-2021r1/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe:
C:\Users\xx\AppData\Local\Temp\arduino_build_855237\sketch\Minimal.ino.cpp.o: in function `setup()':
C:\Users\xx\Documents\Arduino\libraries\mDash\examples\Minimal/Minimal.ino:26: undefined reference to `mDashInit'
collect2.exe: error: ld returned 1 exit status

The IDE is 1.8.19 and i tested with two version of the ESP32 core : 2.0 and the current master branch. In both cases it fails at the collect step.

cpq commented 2 years ago

Please try the latest version - tested and works with Arduino 1.8.19