arduino ide Compiler error

im getting this compiler error sometimes. i just try again and it work compiles most of the time. i cant tell exactly by looking at the error whats the cause?

Arduino: 1.8.7 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"



C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv-master/UTFTGLUE.h:52:16: warning: unused parameter 'model' [-Wunused-parameter]

  UTFTGLUE(byte model, int RS, int WR,int CS, int RST, int RD = A0) : MCUFRIEND_kbv(CS, RS, WR, RD, RST) {}

                ^

C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv-master/UTFTGLUE.h:101:51: warning: unused parameter 'deg' [-Wunused-parameter]

  void print(const char *st, int x, int y, int deg=0)  {

                                                   ^

C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv-master/UTFTGLUE.h:103:45: warning: unused parameter 'deg' [-Wunused-parameter]

  void print(char *st, int x, int y, int deg=0)  {

                                             ^

C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv-master/UTFTGLUE.h:105:46: warning: unused parameter 'deg' [-Wunused-parameter]

  void print(String st, int x, int y, int deg=0) {

                                              ^

C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv-master/UTFTGLUE.h:125:66: warning: unused parameter 'divider' [-Wunused-parameter]

  void printNumF(double num, byte dec, int x, int y, char divider='.', int length=0, char filler=' ') {

                                                                  ^

C:\Users\User\Documents\Arduino\libraries\MCUFRIEND_kbv-master/UTFTGLUE.h:125:97: warning: unused parameter 'filler' [-Wunused-parameter]

  void printNumF(double num, byte dec, int x, int y, char divider='.', int length=0, char filler=' ') {

                                                                                                 ^

In file included from C:\Users\User\Downloads\AllInOne\AllInOne.ino:5:0:

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h: In member function 'bool TimerInfos::copyStates(byte, byte)':

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:153:5: warning: no return statement in function returning non-void [-Wreturn-type]

     }

     ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h: In member function 'bool TimerInfos2::copyStates(byte, byte)':

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:317:12: warning: unused variable 'previous' [-Wunused-variable]

       byte previous = Timers2[timerNumber].state = States;

            ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:318:5: warning: no return statement in function returning non-void [-Wreturn-type]

     }

     ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h: In member function 'byte Sequencer::setNewState(byte)':

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:487:3: warning: no return statement in function returning non-void [-Wreturn-type]

   }

   ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h: At global scope:

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:486:25: warning: unused parameter 'newState' [-Wunused-parameter]

   byte setNewState(byte newState) {

                         ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h: In member function 'bool Doses::setFrom(Doses*)':

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:638:28: warning: invalid conversion from 'int*' to 'int' [-fpermissive]

      changes |= doseUpCount=(&in->doseUpCount);

                            ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:639:30: warning: invalid conversion from 'int*' to 'int' [-fpermissive]

      changes |= doseDownCount=(&in->doseDownCount);

                              ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h: In member function 'bool TimerInfos3::setOnTime(byte, uint16_t)':

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:671:3: warning: no return statement in function returning non-void [-Wreturn-type]

   }

   ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h: In member function 'bool TimerInfos3::setOffTime(byte, uint16_t)':

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:674:3: warning: no return statement in function returning non-void [-Wreturn-type]

   }

   ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h: In member function 'bool phInfos::setOnTime(byte, float)':

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:705:3: warning: no return statement in function returning non-void [-Wreturn-type]

   }

   ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h: At global scope:

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:756:28: warning: unused parameter 'tState' [-Wunused-parameter]

   void printStateName(byte tState) {

                            ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:761:21: warning: unused parameter 'select' [-Wunused-parameter]

 void charOrDot(bool select, char display) {

                     ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:761:34: warning: unused parameter 'display' [-Wunused-parameter]

 void charOrDot(bool select, char display) {

                                  ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:764:23: warning: unused parameter 'select' [-Wunused-parameter]

 void charOrBlank(bool select, char display) {

                       ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:764:36: warning: unused parameter 'display' [-Wunused-parameter]

 void charOrBlank(bool select, char display) {

                                    ^

C:\Users\User\ArduDebug\Build\sketch\packetDefinitions.h:767:35: warning: unused parameter 'display' [-Wunused-parameter]

 void charIfTrue(bool select, char display) {

                                   ^
compilation terminated.

c:/users/user/documents/arduino-1.8.7/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

Multiple libraries were found for "RF24.h"
 Used: C:\Users\User\Documents\Arduino\libraries\RF24-master
 Not used: C:\Users\User\Documents\arduino-1.8.7\libraries\RF24-master
Using library RF24-master at version 1.3.1 in folder: C:\Users\User\Documents\Arduino\libraries\RF24-master 
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
compilation terminated.

I wonder if this was caused by too many warnings. I would turn on verbose messages during compilation to see if that provides more details.

/ld.exe: error: lto-wrapper failed

This is a linker error. The verbose messages might help here, too.

Good luck. If all else fails, re-install the IDE.

Hmm, i have verbose on, and i have compiler messages set to all. When it happens again ill post a text file of the error

Here’s the full error without me removing any of it to satisfy the 9000 char limit…

error message.txt (22 KB)

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 traditional 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”.

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.