davetcc / tcMenu

Menu library for Arduino, mbed and ESP with designer UI and remote control capabilities.
https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/
Apache License 2.0
272 stars 25 forks source link

Compile fails after upgrading to v4.0(undefined reference to `_Z9setupMenuv') #377

Closed davetcc closed 11 months ago

davetcc commented 12 months ago

Set the default option back to source and generated code together, anything else is not supported by regular Arduino build system.

Discussed in https://github.com/davetcc/tcMenu/discussions/376

Originally posted by **prowong** July 7, 2023 All things work fine in v3.1. But after upgrading to v4.0, I just created a very simple menu with only two items, and the compilation error message is as follows. I've tried a full clean install with the same result. On the other hand, when opening the old version of the project in v4.0 and generating code, the compilation is successful. Any suggestions? `d:/program files/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\Patrick\AppData\Local\Temp\arduino\sketches\3797C9C34B5C4AC64A24480549BFE714\sketch\VNC008.ino.cpp.o:(.text.setup+0x0): undefined reference to `_Z9setupMenuv' collect2.exe: error: ld returned 1 exit status`
davetcc commented 12 months ago

Should you hit this issue, simply set the build location property to all in one location (select root menu item in tree). we'll look at other options like a local library (which I think Arduino supports later.

davetcc commented 11 months ago

Unfortunately, there are no easy answers for regular Arduino build, it does not support local libraries in the lib directory, and it does not support subfolders, so for Arduino, everything must be in one directory.

PlatformIO, cmake and probably mbed - you can use any directory/storage option you like. Arduino CLI/IDE - there must be not be a generated subfolder.