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
Hot Topic (More than 8 Replies) Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status (Read 8857 times)
RichardPh
Newbies
*
Offline


Posts: 5
Joined: Feb 18th, 2016
Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status
Feb 18th, 2016 at 2:33pm
Print Post  
I’m encountering an issue when attempting to compile a project for Arduino Mega2560.  This project compiles correctly in the Arduino IDE – I’ve tried vanilla 1.6.7 and am presently using 1.6.8 Hourly Build 2016/01/27 03:44, upgrading didn’t help the issue.
 
Sketch uses 60,870 bytes (23%) of program storage space. Maximum is 253,952 bytes.
Global variables use 3,120 bytes (38%) of dynamic memory, leaving 5,072 bytes for local variables. Maximum is 8,192 bytes.
 
 
However when compiling with Visual Micro Release (1602.13) - 13th February 2016 (and many previous releases) I get the error:
 
Compiling 'SampleProgram' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
libc.a(isprint.o)*:In function `isprint
(.text.avr-libc+0x6)*:relocation truncated to fit: R_AVR_13_PCREL against symbol `__ctype_isfalse' defined in .text.avr-libc section in c:\program files r6\libc.a(cty_isfalse.o)
collect2.exe*:error: ld returned 1 exit status
Error creating .elf
 
I’m using Visual Studio 2015 Pro, v14.0.24720.00 Update 1.  Visual Micro is set to use Arduino 1.6 with Arduino/Genuino Mega w/ ATmega2560 (Mega 2560) option.   I have built, rebuilt, cleaned the compilation, no difference.  Deep Search Includes enabled/disabled makes no difference.  If I turn on verbose messages and do a clean build I get the info below.  Some information has been redacted.
 
 
Any suggestions as to how to resolve?  Given that Arduino IDE compiles OK I’m assuming it’s a Visual Micro issue, but..
  
Back to top
 
IP Logged
 
RichardPh
Newbies
*
Offline


Posts: 5
Joined: Feb 18th, 2016
Re: Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status
Reply #1 - Feb 18th, 2016 at 2:35pm
Print Post  
Visual Micro IDE Verbose Compilation Output:
http://pastebin.com/Q2pgRKgQ

Arduino IDE Verbose Compilation Output:
http://pastebin.com/r6K7WZ7b
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status
Reply #2 - Feb 19th, 2016 at 7:37pm
Print Post  
Hi,

Did you try with the current release f arduino 1.6.7. I haven't tried the beta that you have installed yet. The hourly beta builds can change very quickly.

Hopefully okay with 1.6.7 release
  
Back to top
IP Logged
 
RichardPh
Newbies
*
Offline


Posts: 5
Joined: Feb 18th, 2016
Re: Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status
Reply #3 - Feb 22nd, 2016 at 8:52am
Print Post  
As per original post, error is present with Arduino IDE 1.6.7.  Upgrade was undertaken with the hope that it may fix.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status
Reply #4 - Feb 22nd, 2016 at 11:57am
Print Post  
please zip and email your project to info[at]visualmicro.com
  
Back to top
IP Logged
 
RichardPh
Newbies
*
Offline


Posts: 5
Joined: Feb 18th, 2016
Re: Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status
Reply #5 - Apr 8th, 2016 at 2:40pm
Print Post  
Can't really email unfortunately, project is not open source.  Would need NDA before releasing (if could even get permission).

Believe the issue is related to 64kb boundaries but no idea on how to fix Visual Micro for this.  Running on 1.6.8 full release now and still the same, Arduino IDE no problems, Visual Micro on VS2015 fails.

Believe it's likely related to issues like:
http://www.visualmicro.com/forums/YaBB.pl?num=1420502328
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status
Reply #6 - Apr 8th, 2016 at 2:46pm
Print Post  
Thanks, yes Visual micro isn't forcing the -relax switch for the mega compile. It's a hard coded compiler flag that sits  outside of the std arduino config. I checked it a few months ago so am surprised to see it missing.

I will fix this weekend but you can probably fix it yourself by adding -relax to the c/cpp extra flags in the visual micro project properties

Sorry I missed that and thanks for the pointer.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status
Reply #7 - Apr 8th, 2016 at 7:39pm
Print Post  
Correction requires --relax for the c.elf compiler flags 

New build published thanks
« Last Edit: Apr 8th, 2016 at 8:28pm by Tim@Visual Micro »  
Back to top
IP Logged
 
RichardPh
Newbies
*
Offline


Posts: 5
Joined: Feb 18th, 2016
Re: Visual Micro/Mega2560 Compilation Issues - collect2.exe*:error: ld returned 1 exit status
Reply #8 - Apr 11th, 2016 at 12:59pm
Print Post  
All compiling fine now, thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint