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.