Win10: ... cannot find -lgcc collect2.exe: error: ld returned 1 exit status

Hello,

My son (has been experimenting with his Arduino Uno, we are running the Arduino IDE software on a Windows 10 Macbook Air. We tried it on iOSX but we have this com port issue (chinese Arduino I guess). For school we needed to install Windows 10. And it has been working fine ... but now we keep getting this error:

//mac/home/documents/arduinodata/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe: cannot find -lgcc

collect2.exe: error: ld returned 1 exit status

exit status 1
Fout bij het compileren voor board Arduino/Genuino Uno

I have search all the internet to find a solution, we reinstalled Windows 10, 2 times already and also the Arduino software ... and it just cannot compile anything towards to the Arduino Uno.

Does anyone have a solution for us? We are at a complete loss ...

I am not an expert, so I hope to get some dummy proof advice :slight_smile: Thanks a lot!

What's the line immediately before that in the verbose compiler output? I want to see the command it's trying to invoke - it looks to me like the command is malformed, such that the linker is interpreting -lgcc as a file to operate on rather than a parameter. But without seeing the command it's trying to run, I couldn't make a guess about why or how to fix.

Hello DrAzzy,

Thanks for the reply, the problem is that it does this with every sketch my son has made. So sketches that have worked fine before, now all give this error.

Here an example of a sketch he used:

int led = 9;
int brightness = 0;
int fadeAmount = 5;

void setup() {

pinMode(led, OUTPUT);
}

void loop() {
analogWrite(led, brightness);

brightness = brightness + fadeAmount;

if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}

delay(30);
}

DrAzzy:
What's the line immediately before that in the verbose compiler output? I want to see the command it's trying to invoke - it looks to me like the command is malformed, such that the linker is interpreting -lgcc as a file to operate on rather than a parameter. But without seeing the command it's trying to run, I couldn't make a guess about why or how to fix.

Again...

Sorry I am new at this, and I am not sure what you mean with verbose compiler output. If you mean the Red bar above the error message (in the black textbox below), then it says (translated from Dutch):

Error with compiling for board Arduino/Genuino Uno

Is this what you mean?

File -> preferences
Tick option show verbose output during: compilation
Click OK

Compile.

Post here; you might have to attach it as it might be too big. Or if you can find the specific error line, post a few lines directly before it and the error line.

PS
Did you try a complete re-install of the IDE?

Got it! Thanks, I have it in Dutch so "verbose" didn't ring a bell.

Okay got a very large message. I have put it in a PDF and marked text in Red that is also in the Arduino IDE in Red.

I think this might be the error:

Archiving built core (caching) in:
C:\Users\MACBOO~1\AppData\Local\Temp\arduino_cache_457832\core\core_arduino_avr
_uno_38df7c1b84cd2f1c474e99167b579144.a

Please see the attachment for the complete compilation message.

Yes we reinstalled the Arduino IDE 2x and even Windows 10 2x .. nothing seems to help.

Thanks!

Arduino Error.pdf (127 KB)

This is the error

Linking everything together...
"\Mac\Home\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-
arduino2/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -
mmcu=atmega328p -o
"C:\Users\MACBOO~1\AppData\Local\Temp\arduino_build_885709/Fade.ino.elf"
"C:\Users\MACBOO~1\AppData\Local\Temp\arduino_build_885709\sketch\Fade.ino.cpp.o"
"C:\Users\MACBOO~1\AppData\Local\Temp\arduino_build_885709/core\core.a" "-
LC:\Users\MACBOO~1\AppData\Local\Temp\arduino_build_885709" -lm
//mac/home/documents/arduinodata/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-
arduino2/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe: cannot find -lgcc
collect2.exe: error: ld returned 1 exit status
exit status 1
Fout bij het compileren voor board Arduino/Genuino Uno

The archiving us an informative message; I think somebody has requested on github to change that colour as it's confusing.

Can't help to solve it; might have time at a later stage.

Okay thanks for finding the error.

that is one step closer to a possible solution.

Thanks!

Albert

The only thing that I can find for lgcc relates to 32bit/64bit.

But I noticed that you use the store app version that has given plenty of people grief. I sugget that you uninstall that and install the normal version (Windows Installer, for Windows XP and up) from https://www.arduino.cc/en/Main/Software.

Hello Sterretje,

Thanks that was the issue! I removed the App version installed the one from the website and now it works again like a charm!

Thanks a lot!! My son is soo happy!!

Stars for you Sterretje!! :slight_smile:

alexander060418:
Stars for you Sterretje!! :slight_smile: