Exit status 1

I’m new on Arduino … i’m getting this error when compiling my program.
How to approach this ?

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\libraries\Ethernet\src\EthernetClient.cpp: In member function ‘connect’:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\libraries\Ethernet\src\EthernetClient.cpp:40: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

exit status 1
Error compiling for board Arduino/Genuino Uno.

I’m adding my code also …:
/*
Arduino Ethernet Shield Prototyping,V2.0.
SPI.h, Ethernet2.h Library from Aruduino.cc
*/

#include <SPI.h>
#include <Ethernet.h>

EthernetServer server(80);// Server port

const byte auxPin = 8;// Select pin for Auxillary Power Gate
byte mac = { 0x90, 0xA2, 0xDA, 0x10, 0x65, 0xAE };// Physical MAC address
byte ip = { 192, 168, 6, 25 };// Fixed IP address
byte gateway = { 192, 168, 6, 254 };// Router Gateway Internet access
byte subnet = { 255, 255, 255, 0 };// Subnet mask */
String readString;

void setup()
{
delay(300);// Delay for Ethernet shield initialization (Arduino has 65mS Power Up delay and W5100 reset logic has 280mS)
pinMode(auxPin, OUTPUT);// Define pin for Auxillary Power as Output
Serial.begin(9600);// Initialize serial communications at 9600 bps
Serial.println(F(“Arduino UNO R3 with Ethernet Shiled W5100 - VU3GAO, for xxx”));// Display Arduino title
Ethernet.begin(mac,ip,gateway,subnet);// Start Ethernet
server.begin();
Serial.print(F("Ethernet Shield initialized. Local IP address is: "));
Serial.println(Ethernet.localIP());// Print Server IP address
}

void loop()
{
EthernetClient client = server.available();// Create a client connection
if (client)
{
while (client.connected())
{
if (client.available())
{
char c = client.read();// Read char by char HTTP request
if (readString.length() < 100)
{
readString = readString + c;// Store characters to string
}
if (c == ‘\n’)
{
Serial.println(readString);
client.println(F(“http/1.1 200 ok”));// Send standard http headers
client.println(F(“content-type: text/html”));
client.println();
client.println(F("<!doctype html>"));
client.println(F(""));
client.println(F(“Home Web Control”));
client.println(F(“

xxx Gate Control

”));
client.println(F(“

xxx

”));
client.println(F("

Click the Buttons to test the gate opening.


“));
client.print(F(”<input type=button value=‘Open Gate’ onmousedown=location.href=’/?AP_on’>"));
client.println(F("<input type=button value=‘Close Gate’ onmousedown=location.href=’/?AP_off’>


")); client.println(F("")); delay(1);// Page loading delay client.stop();// Stopping client

if(readString.indexOf("/?AP_on") > 0) digitalWrite(auxPin, HIGH);// Switch on Auxillary Power
if(readString.indexOf("/?AP_off") > 0) digitalWrite(auxPin, LOW);// Switch off Auxillary Power
readString = “”;// Clearing string for next read
}// End of line reached
}// End of client available
}// End of client connected
}// End of client connection
}// End of loop

Looks like you're using the windows store app. Get rid of it and install the normal version and try again.

PS1
Programming questions are for problems with your code :wink: This is not a problem with your code.

PS2
Personal opinion: install IDE 1.8.5, not 1.8.7

This bug is specific to the 5.4.0-atmel3.6.1-arduino2 version of avr-gcc used by Arduino AVR Boards 1.6.22 and newer. It has been reported here:

Here's the workaround:

  • Tools > Board > Boards Manager
  • Wait for downloads to finish.
  • When you move the mouse pointer over "Arduino AVR Boards", you will see a "Select version" dropdown menu appear. Select "1.6.21".
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".

Due to a bug, this workaround doesn't work with Arduino IDE 1.8.6, but it will work with any other version of the Arduino IDE.

If you have File > Preferences > Check for updates on startup checked, the Arduino IDE may occasionally notify you that a new version of Arduino AVR Boards is available, you'll need to refrain from updating back to the new Arduino AVR Boards version, otherwise you'll be back to seeing the segmentation fault error again.

Many thx to pert, this solved my problem