Compiler gets slashes the wrong way?

Using 1.8.1.0, installed via Windows store.

About 4 times out of every 5, I've been getting compiler errors when I try to upload my code. It gives me:

collect2.exe: error: ld returned 5 exit status

I've got verbose turned on, and it's set to give me all warnings as well, but there was never any more information about the error than just that. Usually I could just click upload again and it would work, but then I got to playing around with something else (I've got an arduino-based PLC that uses a lot of custom and or bashed together libraries) and I figured that there was a problem somewhere in my code that just wasn't letting me compile.

Turns out... it's a problem in the compiler itself.

"C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.1.0_x64__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560  -o "c:\TEMP/PLC_touchscreen_test2.ino.elf" "c:\TEMP\sketch\PLC_touchscreen_test2.ino.cpp.o" "c:\TEMP\libraries\TMRpcm_PLDuino\TMRpcm_PLDuino.cpp.o" "c:\TEMP\libraries\TMRpcm_PLDuino\pcmRF.cpp.o" "c:\TEMP\libraries\SD\File.cpp.o" "c:\TEMP\libraries\SD\SD.cpp.o" "c:\TEMP\libraries\SD\utility\Sd2Card.cpp.o" "c:\TEMP\libraries\SD\utility\SdFile.cpp.o" "c:\TEMP\libraries\SD\utility\SdVolume.cpp.o" "c:\TEMP\libraries\SPI\SPI.cpp.o" "c:\TEMP\libraries\Adafruit-GFX-Library-master\glcdfont.c.o" "c:\TEMP\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp.o" "c:\TEMP\libraries\Adafruit_ILI9341-master\Adafruit_ILI9341.cpp.o" "c:\TEMP\libraries\PLDuino\PLDuino.cpp.o" "c:\TEMP\libraries\PLDTouch\PLDTouch.cpp.o" "c:\TEMP\libraries\PLDuinoGUI\Button.cpp.o" "c:\TEMP\libraries\PLDuinoGUI\GridLayout.cpp.o" "c:\TEMP\libraries\PLDuinoGUI\Label.cpp.o" "c:\TEMP\libraries\PLDuinoGUI\Layout.cpp.o" "c:\TEMP\libraries\PLDuinoGUI\LinearLayout.cpp.o" "c:\TEMP\libraries\PLDuinoGUI\Utils.cpp.o" "c:\TEMP\libraries\PLDuinoGUI\Widget.cpp.o" "c:\TEMP\libraries\DS3232RTC-master\DS3232RTC.cpp.o" "c:\TEMP\libraries\Time-master\DateStrings.cpp.o" "c:\TEMP\libraries\Time-master\Time.cpp.o" "c:\TEMP\libraries\Wire\Wire.cpp.o" "c:\TEMP\libraries\Wire\utility\twi.c.o" "c:\TEMP/core\core.a" "-Lc:\TEMP" -lm
collect2.exe: error: ld returned 5 exit status

Look at that last thing.

"c:\TEMP/core\core.a" "-Lc:\TEMP" -lm
collect2.exe: error: ld returned 5 exit status

It looks like it's trying to call for:

"c:\temp\core\core.a" -L
"c:\temp" -lm

but it's got one of the slashes wrong in the first line, and the -L flag for core.a is located inside the quotes for c:\temp.

Any idea why this is happening? Particularly, why it's happening sometimes but not every time?

edit to add: I'm a complete n00b at this. The last time I did any real coding, line numbers were still mandatory.

Upgrade to 1.8.2

That's a bug with the linker under XP. It's been present from 1.5.something through 1.8.1, and since 1.6.12, the workaround of replacing the linker with an old version no longer worked (because there was another compiler update, and we now use a new command line option on the linker (link time optimization) that allows us to shrink the size of the compiled sketch by about 10-15% for free). Just recently - probably in response to that - someone did the legwork of figuring out what was wrong and fixing it, the fix is in 1.8.2. Note that the fix is actually within the board package, not the IDE itself, so if you have previously used board manager to update the Arduino AVR boards package under a 1.6.4+ version of the IDE, you will need to update it in board manager as well.

There's no problem with the direction of the slashes; Even back in XP, windows was smart enough to accept slashes in either direction

Okay, thanks.

I'm pretty sure that I haven't done anything with the boards package, since ... well, I don't actually even know what that is, yet.

I'll go find the update now! Thanks again!