Eliza Example not working for Arduino Mega 2560

Hello,

I have the Arduino Mega 2560 (I think it is the R3 one) and I cannot upload the Eliza proficient example. I get this error message:

Arduino: 1.8.8 (Windows Store 1.8.19.0) (Windows 10), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

In function ‘global constructors keyed to 65535_0_Eliza.ino.cpp.o’:

lto1.exe: 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.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files/windowsapps/arduinollc.arduinoide_1.8.19.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 Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

RMC,

This is a problem with your Arduino IDE installation. Have you tried compiling any other example?

Gerald

One of them used to work, but now none work. Do I need to install again? How do I fix it?

Oddly enough, it now compiles with no error. I didn’t change anything. I was having the same trouble with my code, which was a similar implementation of the intermediate Eliza example. I wasn’t using if(res==SILENCE), but when I added that part, it compiled with no errors. I would like to know why that piece of code makes such a big difference?

This code makes no difference at compile time.

Your Arduino IDE installation had/has issues. I am glad it started to work for you, otherwise I would have recommended starting a thread in the Arduino forum.

Gerald