Lto1.exe error when compiling arduino mega

lto1.exe: note: array types have different bounds

Sketch uses 35636 bytes (14%) of program storage space. Maximum is 253952 bytes.
Global variables use 2380 bytes (29%) of dynamic memory, leaving 5812 bytes for local variables. Maximum is 8192 bytes.

any idea what the issue is? I’m not getting a lot of info from the error.

EDIT:

Here’s the line with verbose output enabled.

"D:\\Google Drive\\Projects\\arduino-1.8.7\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251/OpenMQTTGateway.ino.elf" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\sketch\\OpenMQTTGateway.ino.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\PubSubClient\\PubSubClient.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\Ethernet\\Dhcp.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\Ethernet\\Dns.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\Ethernet\\Ethernet.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\Ethernet\\EthernetClient.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\Ethernet\\EthernetServer.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\Ethernet\\EthernetUdp.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\Ethernet\\socket.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\Ethernet\\utility\\w5100.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\rc-switch\\RCSwitch.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251/core\\core.a" "-LC:\\Users\\Kevin\\AppData\\Local\\Temp\\arduino_build_71251" -lm
lto1.exe: note: array types have different bounds

OK, so I was using the portable version of the arduino IDE so I redownloaded it, copied it over the existing folder replacing files (it was the same version 1.8.7). Then I recoppied the libraries from the github into my libraries folder. After all that I still get the error but it compiled and uploaded and appears to be working. I can see the initial boot message at my mqtt broker saying that it is online and what version of the software it’s running.

Hope this helps someone else.

1 Like