Collect2 error

I downloaded the latest firmware files and the latest Arduino install. When I compile I get the short error below. Enabling verbose I get the long error below.

Any suggestions why I am getting a collect2 error? I have the correct board selected. I am not sure what file is missing. All the files int he last section seem to exist.

Mike

------------------------- short error -----------------------------

Arduino: 1.6.5 (Windows 7), Board: "CANBus Triple"

Build options changed, rebuilding all

collect2.exe: fatal error: CreateProcess: No such file or directory
compilation terminated.
Error compiling.

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

---------------------------- long error (edited because of max length in forum -----------------------

Arduino: 1.6.5 (Windows 7), Board: "CANBus Triple"

Build options changed, rebuilding all

Using library CANBus in folder: C:\Users\mycall\Documents\Arduino\hardware\CANBus-Triple\avr\libraries\CANBus

Using library SPI in folder: C:\Users\mycall\Documents\Arduino\hardware\CANBus-Triple\avr\libraries\SPI

Using library EEPROM in folder: C:\Users\mycall\Documents\Arduino\hardware\CANBus-Triple\avr\libraries\EEPROM

Using library QueueArray in folder: C:\Users\mycall\Documents\Arduino\hardware\CANBus-Triple\avr\libraries\QueueArray (legacy)

<snip>

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc -w -Os -flto -Wl,--gc-sections -mmcu=atmega32u4 -o C:\Users\mycall\AppData\Local\Temp\build3827385021889454149.tmp/CANBusTriple.cpp.elf C:\Users\mycall\AppData\Local\Temp\build3827385021889454149.tmp\CANBusTriple.cpp.o C:\Users\mycall\AppData\Local\Temp\build3827385021889454149.tmp\CANBus\CANBus.cpp.o C:\Users\mycall\AppData\Local\Temp\build3827385021889454149.tmp\CANBus\Message.cpp.o C:\Users\mycall\AppData\Local\Temp\build3827385021889454149.tmp\SPI\SPI.cpp.o C:\Users\mycall\AppData\Local\Temp\build3827385021889454149.tmp\EEPROM\EEPROM.cpp.o C:\Users\mycall\AppData\Local\Temp\build3827385021889454149.tmp/core.a -LC:\Users\mycall\AppData\Local\Temp\build3827385021889454149.tmp -lm

collect2.exe: fatal error: CreateProcess: No such file or directory
compilation terminated.
Error compiling.

So I uninstalled and reinstalled the IDE several times. No luck. I then installed the previous version 1.6.3 of the Arduino IDE and got a clean compile. Looks to me like there is a problem with the current firmware release and the latest version (1.6.4) of the IDE.

Additional info. I needed to install a build system on a second computer. I simply installed 1.6.3 and got the same collect2 error I was getting before! It turns out that in fixing the issue before I forgot I had also installed and uninstalled 1.6.2 of Arduino. Repeating that sequence I did the following on the new system.

  1. Install 1.6.3, attempted to compile and got collect2 error
  2. Install 1.6.2, attempted to compile and got a collect2 error
  3. Installed 1.6.3 again. Now things compile.

I am new to Arduino. Could it be installing 1.6.2 then installing 1.6.3 on top of it somehow left something behind that is needed?

I had the same problem with the Arduino IDE 1.6.5. Here's what I did to get the CANBusTriple example to compile and upload on Windows 7:

  • Clone the repo in a folder like Downloads
  • Go to Downloads\CANBus-Triple\avr
  • Copy the example folder examples\CANBusTriple to your Arduino sketch folder (in my case Documents/Arduino)
  • Copy the libraries\CanBus and libraries\QueueArray folders to your Arduino libraries folder (in my case Documents/Arduino/libraries)
  • Copy the variants\canbustriple folder to your Arduino variants folder (for me C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants)
  • Open boards.txt in a text editor and open C:\Program Files (x86)\Arduino\hardware\arduino\avr\boards.txt in a text editor using Open as System Administrator. Copy the text in the CANBus-Triple boards.txt into the top of the Arduino boards.txt file, save and exit.
  • Open the Arduino IDE 1.6.5 and then open the CANBusTriple sketch you saved in the Arduino sketch folder.
  • Click on Tools->Boards and pick "CANBus Triple", also pick the port.
  • Ctrl-R should successfully compile, and Ctrl-U should upload.

I believe the problem is in the platform.txt file in the repo.
Some of this info can be found on the Arduino playground under "Customizing the Arduino IDE".

I have the same problem compiling on windows. It seems related to a "-flto" compile option added to platform.txt file with last code commit.
To solve the problem just edit file CANBus-Triple\avr\platform.txt and remove all occurencies of "-flto" string. There are three of them, on lines 11, 14 and 18.

The "-flto" flag activates the GCC linker plugin for Link-Time-Optimization (LTO), but some windows versions of Arduino IDE don't include this plugin.
Since version 1.6.4 the plugin was permanently removed as it is not correctly delivered in the AVR GCC tool chain for Arduino.
See here: http://couponsmeup.appspot.com/github.com/mikaelpatel/Cosa/issues/338

Thanks. I'll try this, it's much simpler than my solution.

administrators

Ouch, I didn't know that was not available in Windows. The mazda firmware has grown so large this flag helps get it small enough to flash to the hardware. I'll fix this asap.

Thanks for posting your solution regarding the removal of the <code>-flto</code> flag, @Emanuele‌, I was having the same issue and a quick Google search led me to this post which resolved the issue for me. :)

Looks like your connection to CANBus Triple was lost, please wait while we try to reconnect.