MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.17k stars 19.21k forks source link

[BUG] YHCB2004 - undefined reference to `operator delete(void*, unsigned int)' #26571

Closed NoahJaehnert closed 2 months ago

NoahJaehnert commented 8 months ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

Pulled the latest version of Marlin Bugfix-2.1.x (bb557e5).

Upon compiling, I get the following error:

In file included from .pio/libdeps/mega2560ext/LiquidCrystal/LiquidCrystal_SR1W.cpp:48:0:
.pio/libdeps/mega2560ext/LiquidCrystal/LiquidCrystal_SR1W.h:168:1: warning: multi-line comment [-Wcomment]
 //             |    |      0.1uF            |     \
 ^
/var/folders/3h/zglp2t_141q_7sdtq0d0lf700000gn/T//ccN293xt.ltrans4.ltrans.o: In function `global destructors keyed to 65535_1_HAL.cpp.o.21605':
<artificial>:(.text.exit+0x28): undefined reference to `operator delete(void*, unsigned int)'
collect2: error: ld returned 1 exit status

Per a conversation in #support-chat on Discord, Dust confirmed "enabling #define YHCB2004 on stock ramps configs is sufficient to triggger it" and that the bug was introduced here: https://github.com/MarlinFirmware/Marlin/commit/ec7ab5a277a0210e1349f9e8608c372e40fdb6e6

Also, per Dust: "that library does not like the changes in avr.ini (reverting just changes to avr.ini and it builds again)"

Bug Timeline

New bug

Expected behavior

Expect to be able to successfully compile Marlin

Actual behavior

Unable to successfully compile Marlin

Steps to Reproduce

  1. Pull (bb557e5) version of Marlin Bugfix-2.1.x
  2. Enable/Define YHCB2004 (#define YHCB2004)
  3. Compile Marlin
  4. Receive error as stated above

Version of Marlin Firmware

Marlin bugfix-2.1.x

Printer model

Geeetech A10M

Electronics

Geeetech A10M GT2560_V4.1B board with TMC2208 stepper drivers

LCD/Controller

Geeetech A10M Default (YHCB2004)

Other add-ons

No response

Bed Leveling

UBL Bilinear mesh

Your Slicer

Cura

Host Software

OctoPrint

Don't forget to include

Additional information & file uploads

No response

ellensp commented 8 months ago

YHCB2004 uses these two external libraries red-scorp/LiquidCrystal_AIP31068@^1.0.4, red-scorp/SoftSPIB@^1.1.1

delete is mentioned in https://github.com/red-scorp/LiquidCrystal_AIP31068/blob/master/LiquidCrystal_AIP31068_SPI.cpp#L58

ellensp commented 8 months ago

also from https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html "The name ‘gnu++1z’ is deprecated"

‘gnu++17’
‘gnu++1z’
GNU dialect of -std=c++17. This is the default for C++ code. The name ‘gnu++1z’ is deprecated.
ellensp commented 4 months ago

@NoahJaehnert Can you test a potential fix for me? I know it builds

update features.ini replace YHCB2004 = red-scorp/LiquidCrystal_AIP31068@^1.0.4, red-scorp/SoftSPIB@^1.1.1

with YHCB2004 = LiquidCrystal_AIP31068=https://github.com/ellensp/LiquidCrystal_AIP31068/archive/refs/heads/update-for-marlin.zip, red-scorp/SoftSPIB@^1.1.1

This forces marlin to use the library from my repo with my updates

Just for Information sake: The important change being https://github.com/red-scorp/LiquidCrystal_AIP31068/commit/3fc43b70d34dba5a5aae39024906e1929a0ee3a2

github-actions[bot] commented 2 weeks ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.