1.6.3 ld returmed 5 exit status error with a struct in a class?

This may help to solve the issue some people had with 1.6.3

I did some class devlopment around a very simple kalman filter and start to play with a private struct to store filter variables inside my class.

Main program compiled well using up to two instances (x and y axis) in my main program.

After adding a third axis z in the main program ld failed:

collect2.exe: error: ld returned 5 exit status Error compiling.

Give 1.0.6 a try and I can add much more axis without any further issues.

So far so good.

After removing the struct used for the Kalman filter variables and replacing them by using variables in the private section of my class code compiled well?

Is there an optimisation issue in the ld program of version 1.6.3 ?

My platform is Windows.

f41_ardu: Is there an optimisation issue in the ld program of version 1.6.3 ?

Until you provide an example that illustrates the problem there is no way anyone except you can answer that question.

Looks like an extremly strange issue.

Update. After adding more axis error come back. See my latest posting, solution is weired but solved the issue.

Weired solution, but it is working now.

First I try to copy ld.exe and ld.bfd.exe from 1.6.0, 1.5.8. For both versions my code compile well.

Path is c:\Arduino\arduino-1.6.3\hardware\tools\avr\avr\bin\

Got other error messages, no success.

Last try to get rid ld*.exe. So I renamed ld.exe and ld.bd.exe -> oldld.exe and ld.bd.exe.

And now it is working.

Could someone try to verify this solution.

I start to heck all my Arduino code and own libaries, and so far it looks quite good.

f41_ardu: Could someone try to verify this solution.

See Reply #1.

f41_ardu, if you are using IDE 1.6.1, 1.6.2 or 1.6.3 on Windows XP, you are not the only running into this issue; you can find many posts about it.

I discovered another work-around for this issue, see my last post in this thread: link

oldmaker: f41_ardu, if you are using IDE 1.6.1, 1.6.2 or 1.6.3 on Windows XP, you are not the only running into this issue; you can find many posts about it.

I discovered another work-around for this issue, see my last post in this thread: link

See my solution http://forum.arduino.cc/index.php?topic=310950.0.

Verification with most of my code is ongoing.

Hi f41_ardu, you are rigth, at least partially. At last I found time for a complete series of tests about your solution; these are the results:

Context: IDE 1.6.3, Windows XP SP3, Arduino Uno Test 1: files ld.exe and ld.bfd.exe copied from a previous IDE version Test 2: file ld.exe copied from a previous IDE version and original ld.bfd.exe Test 3: only file ld.exe copied from a previous IDE without ld.bfd.exe

  • Files from IDE 1.6.0, tests 1, 2 and 3 result: "collect2.exe: error: ld returned 53 exit status", without Windows crash

  • Files from IDE 1.5.8, tests 1, 2 and 3 result: "collect2.exe: error: ld returned 53 exit status", without Windows crash

  • Files from IDE 1.0.6, tests 2 and 3 result: SUCCESS ! :D The sketch compiles fine

Note 1: I remind that using IDE 1.6.1, 1.6.2 or 1.6.3, the result is a Windows crash message followed by "collect2.exe: error: ld returned 5 exit status".

Note 2: using file ld.exe copied from IDE 1.0.6, there is no need to rename original ld.bfd.exe, because in 1.0.6 it doesn't exist.

Finally, your solution is OK: - in IDE 1.6.1, 1.6.2 or 1.6.3, rename the file ld.exe (i.e. OLD-ld.exe) in directory C:\Programs\Arduino\hardware\tools\avr\avr\bin; - copy another file ld.exe from IDE 1.0.6.

Seems to be a (random) integer division bug in the compiler.

See my post here: http://forum.arduino.cc/index.php?topic=310950.msg2272209#msg2272209