Arduino v1.6.10 linker bug ?

Hi,

I'm using v1.6.10 on WinXP (and v1.6.9 on CentOS 7x).
I need to use scanf() to parse float number (well, I know it's not a good approach. but my code is small, I don't care space). In order to use scanf() for float number, I add the following linker flags:

-Wl,-u,vfscanf -lscanf_flt -lm

The above flags are put in c:\Program Files\Arduino\hardware\tools\arduino\avr\platform.local.txt:

compiler.c.elf.extra_flags=-Wl,-u,vfscanf -lscanf_flt -lm

It works on Arduino 1.6.9 for Linux (CentOS 7x) but when I try to build
my code under WinXP using Arduino 1.6.10, I got the following error message:

collect2.exe error ld returned 5 exit status

Does anyone has similar issue ? My customer has Windows only, so
I need it works under Windows. Thanks a lot.

Regards
KC

I've seen a lot of reports of problems building under Windows XP with recent versions of the IDE.

kcc1967:
Hi,

I'm using v1.6.10 on WinXP (and v1.6.9 on CentOS 7x).
I need to use scanf() to parse float number (well, I know it's not a good approach. but my code is small, I don't care space). In order to use scanf() for float number, I add the following linker flags:

-Wl,-u,vfscanf -lscanf_flt -lm

The above flags are put in c:\Program Files\Arduino\hardware\tools\arduino\avr\platform.local.txt:

compiler.c.elf.extra_flags=-Wl,-u,vfscanf -lscanf_flt -lm

It works on Arduino 1.6.9 for Linux (CentOS 7x) but when I try to build
my code under WinXP using Arduino 1.6.10, I got the following error message:

collect2.exe error ld returned 5 exit status

Does anyone has similar issue ? My customer has Windows only, so
I need it works under Windows. Thanks a lot.

Regards
KC

A common fix for this is to use a copy of "ld.exe" from IDE version 1.0.6.
(That worked for me in IDE V1.6.5 when I was still using WinXP SP3.)

Others have said that running "ld.exe" in compatibility mode for WinXP works too, but I haven't tried that myself, so can't verify it.

If your customer is running a later version of Windows, they shouldn't have this issue, but if one of the above works at least you'll be able to complete the project.

Hi,

Use ld.exe from v1.0.6 or running ld.exe/avr-ld.exe/collect2.exe in compatible mode
do not work for me.

However, I simply downgrade my Arduino IDE to v1.6.5, and my problem go away !!!!!!!

Best Regards,
KC

Arduino v1.6.9 works for WinXP too :wink:

kcc1967:
Arduino v1.6.9 works for WinXP too :wink:

Even V1.6.5 can have the error listed above, and definitely V1.6.9, with the right code. When using WinXP SP3 with IDE V1.6.5, under some conditions I also received that error, and had to swap "ld.exe" for the earlier version before some code would work.

Just because V1.6.9 works with WinXP now doesn't mean that it will work with all code.
The version of "ld.exe" provided with the later versions of the IDE is not fully compatible with WinXP. There are heaps of posts on this issue in these forums, using V1.6.3 (and maybe earlier) right up until the current version of the IDE.

Just Google "collect2.exe error ld returned 5 exit status" and you'll see what I mean.