IDE Error "The filename or extension is too long"

When attempting to compile a Marlin build, I’m getting this error regarding a file called “avr-gcc.exe” in the program file system. The path should defiantly be under the windows limit, and as an attempt to fix it, I moved the Arduino IDE files to the root of my main drive to no avail. Any idea how I could resolve this?

Arduino: 1.8.13 (Windows 10), Board: "Sanguino, ATmega1284 or ATmega1284P (16 MHz)"


fork/exec C:\Arduino\hardware\tools\avr/bin/avr-gcc.exe: The filename or extension is too long.

Error compiling for board Sanguino.

flub9:
fork/exec C:\Arduino\hardware\tools\avr/bin/avr-gcc.exe: The filename or extension is too long.

Do\you/see\the/problem\yet?

\ is the folder delimiter in Windows.
/ is the folder delimiter in Linux.

Using both just confuses the compiler.

Noted, however, from my testing, it appears that modern windows doesn’t care, and that it seems to be a visual thing in the ide only, the actual file address uses the correct slash.

Update: From searching past threads across multiple sites, this appears to be an issue with the IDE, encountered mainly by people configuring Marlin due to its heavy and complex nature. I’ll ask around on the GitHub for both Marlin and Arduino to see where the issue may be and any potential fixes.

SteveMann:
Do\you/see\the/problem\yet?

\ is the folder delimiter in Windows.
/ is the folder delimiter in Linux.

Using both just confuses the compiler.

How to fix? Windows 10.

luciddream:
How to fix? Windows 10.

The easy fix is, don't use Windows.

If you are expecting Windows to parse a filespec, just use "".

Common error when compiling Marlin with the Arduino IDE on a Windows machine, the error message is misleading, actual error is caused by the linker command generated by the IDE exceeding the maximum length allowed by Windows. There is a fix on the way, but currently it has only been implemented on the nightly build of Arduino CLI.

This thread is months old, hopefully the OP is not still waiting for a reply.

Problem solved.
I used Visual Studio Code instead of Arduino IDE.