Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Locked Topic collect2.exe / error creating .elf (Read 4625 times)
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
collect2.exe / error creating .elf
Dec 12th, 2015 at 7:00am
 
I have seen many posts referencing "collect2.exe" or the .elf file, but I haven't seen any answers that worked for my installation. I did learn that if I set Release mode, it does upload the code to the device. So my entire compiler out boils down to this:

Compiling debug version of 'Rover' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
Build folder: file:///C:/Users/Bob/AppData/Local/V.Micro/Arduino/Builds/Rover/mega_atmega2560
BJDualMotor.cpp.o:(.bss.__VisualMicro_GlobalLastMillis__+0x0): multiple definition of `__VisualMicro_GlobalLastMillis__
BJDetector.cpp.o:(.bss.__VisualMicro_GlobalLastMillis__+0x0): first defined here
ld.exe:Disabling relaxation: it will not work with multiple definitions
collect2.exe*:error: ld returned 1 exit status
Error creating .elf
My code has four libraries. BJDualMotor and BJDetector are two of them. 

I need advice on how to debug this. Cry
« Last Edit: Dec 12th, 2015 at 7:00am by Bob Jones »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: collect2.exe / error creating .elf
Reply #1 - Dec 12th, 2015 at 1:20pm
 
Hi Bob,

Please zip and email the folder sown in the output to info[at]visualmicro.com

Are the libraries local sketch libraries or installed in document/arduino/libraries?

Thanks
« Last Edit: Dec 12th, 2015 at 11:24pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: collect2.exe / error creating .elf
Reply #2 - Dec 14th, 2015 at 1:02am
 
I just sent you a ZIP file with my problem project ("Rover") and my libraries folder from my Arduino Projects folder. I hope you can help me jump over this particular hurdle... I am truly stuck.

I also attached the zip file to this post but this attachment is only my code and the output.log and errors.txt (created these from the screen output). 

Thanks... Undecided
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: collect2.exe / error creating .elf
Reply #3 - Dec 14th, 2015 at 3:06am
 
Thanks for the info. There is a  bug fix that should solve this in the latest visual micro update via "tools>extensions and updates".

It was a result of having two breakpoints in two different .cpp source files that both had a millis based "HitCount"  "Condition"

The error was actually this:-

BJDualMotor.cpp.o:(.bss.__VisualMicro_GlobalLastMillis__+0x0): multiple definition of `__VisualMicro_GlobalLastMillis__
BJDetector.cpp.o:(.bss.__VisualMicro_GlobalLastMillis__+0x0): first defined here

The Arduino tool chains often produce the final meaningless "collect2.exe*:error". Visual micro just displays what is returned from the toolchain.exe


tip:

Thanks for the report it was useful, good to see someone making use of the new local library edit/debug facility. Don't forget you can use the toolbar to switch between "Debug/Release" which also would have solved the issue and proven it to be related to debug build.
  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: collect2.exe / error creating .elf
Reply #4 - Dec 14th, 2015 at 7:33am
 
The update fixed the problem. Thanks. 

As I mentioned, I have been a programmer since the bits were rectangular. I am working to build a collection of libraries that support my playing with robots. I am doing this strictly for fun (my day job is PHP/Drupal 6), but I spent 13 years with Visual Studio and C# writing full stack websites (JQuery...LINK). I understand bugs and fixing them. I do it all day.

Thanks for fixing yours so quickly.

Bob
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint