Failure to compile Marlin: error: redefinition of 'struct std::hash<long unsigned int>'

So, I am not much of a code person but have successfully customized marlin for my ender 3 before. I know PIO can be touchy at times, but I am running into an error and cannot figure it out. So when downloading the original marlin package from BTT for the SKR E3 Turbo, I cannot get PIO to compile the firmware even with no changes.

Firmware: GitHub - bigtreetech/BIGTREETECH-SKR-E3-Turbo

The error I am getting. I am using unedited firmware, so the link above is what my Config and Config adv files will be.

Error Message: c:\users\the gun psychiatrist.platformio\packages\toolchain-gccarmnoneeabi\arm-none-eabi\include\c++\10.3.1\bits\functional_hash.h:168:3: error: redefinition of ‘struct std::hash’

At this point, I just want to get marlin to compile successfully first before making any changes. That way I can isolate any issues when they popup. I am far from what you would call a person who can write code. I probably could do hello world if someone showed me step by step. However, I do understand how to edit firmware and why you specify certain things. Course, I think the issue is PIO and not Marlin. I could be wrong.

Please link issues you’ve created in reference to this problem so that it can be found.

I am not sure what that means. Sorry

And well one cheap way to fix the problem is to comment out the double-define, e.g. by getting rid of the wchar_t specialization in the header pointed to by the error.

But that’s not what users are supposed to do. The project hasn’t been updated to use newer Marlin versions for almost 2 years nows, and this version of Marlin uses a platform ( which does not pin the toolchain version (as e.g. seen in Fix compilation error by maxgerhardt · Pull Request #12 · p3p/pio-nxplpc-arduino-lpc176x · GitHub), so breakagaes can happen.

Per compilation log the compile is using

 - framework-arduino-lpc176x @ 0.2.9
 - toolchain-gccarmnoneeabi @ 1.100301.220327 (10.3.1)

but that toolchain version didn’t even exist 2 or 3 years ago, it was only published 1 year ago.

So the obvios way is to go in here

and turn that into

platform_packages =

then recompilation works without problems and no file modifications.

1 Like

@maxgerhardt That fixed the issue! I really appreciate your time and intelligence in this matter. My computer thanks you too. It about took a flight to the parking lot LOL! I have always had a lot of respect for folks who are good at this code stuff. Amazing. Thank you again and have a great evening.

Thank you very much! That helped me too!