You're getting a compiler error. It happens in strange parts of code that really shouldn't be having a problem. The error looks something like:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp:203:1: internal compiler error: Segmentation fault



Please submit a full bug report,

with preprocessed source if appropriate.

See http://gcc.gnu.org/bugs.html for instructions.

lto-wrapper.exe: fatal error: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files/windowsapps/arduinollc.arduinoide_1.8.15.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

What is it, and how do you fix it?

  • Restarting the Arduino IDE may be helpful.
    – user_fs10
    Commented Mar 5, 2020 at 6:52

4 Answers 4


This is a known fault with the compiler in Windows. The annoying thing is that it's the version of the compiler that is included in the Windows Store App version of the Arduino IDE.

It also snuck into the Windows version of the IDE from version 1.8.6 from the Arduino.cc website, with the bundled version of the Arduino AVR core.

There are numerous Github issues open for the problem and navigating the tangled web of them is a bit of a chore, but this one seems to be the most promising for digging into the root cause:

The simplest fix is to downgrade your compiler to 4.9.2. This can be done by using the Boards Manager to install version 1.6.21 of the Arduino AVR Boards. This should give you compiler version 4.9.2-atmel3.5.4-arduino2 which doesn't suffer from the problem.

  • This is the central issue report for this problem: github.com/arduino/Arduino/issues/7949
    – per1234
    Commented Dec 13, 2018 at 22:29
  • and DO NOT press "Update" button before pressing "Close" !! Commented Feb 28, 2019 at 19:00
  • Works like a charm, thanks. Had this is issue with a Arduino/Genuino Micro with the IRremote library.
    – Codebeat
    Commented Sep 17, 2019 at 6:14

I've been having this kind of error off and on lately for no apparent reason. What eliminated it for me was going into the IDE preferences and changing compiler output to verbose and also show all warnings. What??? I know it's crazy. I was just trying to get more information about the error, but I haven't gotten it since. And I was getting it a lot before.

  • Worked for me too. Thank you
    – Jak
    Commented Aug 22, 2019 at 10:37

Sometimes it seems like I have to reboot my PC, as exiting from Arduino and rerunning still doesn't always allow me to compile again.

"changing compiler output to verbose and also show all warnings"

This worked for me too.


I put back the settings to its default state again, after a restart and compile. It worked. Not sure whats under this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.