Arduino Forum

Using Arduino => Installation & Troubleshooting => Topic started by: ardukey on Apr 04, 2015, 01:14 pm

Title: many cases of ld.exe crashes. (on windows xp).
Post by: ardukey on Apr 04, 2015, 01:14 pm
Hi to all,
I've reistalled an old Xp PS3 version.
I understand that xp is not supported any more in many ways, but I always worked with arduino without problems.

Not I encounter many ld.exe crash reports.

I installed arduino 1.6.3
I'm asking to myself if xp is not enough updated to work fine with arduino..

there's some way to understand why I receive these crash, symply adding a line or a variable on a scratch?

(one example: I defined an "int a" in a "if cicle" and it worked, but declaring "int a;" on the top of the scratch, instead of doing that in the "if cicle", it gave a crash)

Please help me,
I'm frustrated..
I don't know what's wrong with my xp.. (arduino version? framenet version? java? .. xp not more supported?)
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: federicofissore on Apr 07, 2015, 09:51 am
please turn verbose compilation on and share the whole output
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: ardukey on Apr 12, 2015, 04:38 pm
Sorry for make you waiting,
the error log is:

Code: [Select]
Arduino: 1.6.3 (Windows XP), Board: "Arduino Uno"

C:\Program Files\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10603 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files\Arduino\hardware\arduino\avr\variants\standard C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\A1.cpp -o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\A1.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\hooks.c.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\WInterrupts.c.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\wiring.c.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\wiring_analog.c.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\wiring_digital.c.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\wiring_pulse.c.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\wiring_shift.c.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\abi.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\CDC.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\HardwareSerial.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\HardwareSerial0.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\HardwareSerial1.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\HardwareSerial2.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\HardwareSerial3.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\HID.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\IPAddress.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\main.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\new.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\Print.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\Stream.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\Tone.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\USBCore.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\WMath.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\WString.cpp.o

Using previously compiled file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\core.a

C:\Program Files\Arduino\hardware\tools\avr/bin/avr-gcc -w -Os -Wl,--gc-sections -mmcu=atmega328p -o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp/A1.cpp.elf C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp\A1.cpp.o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp/core.a -LC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build1553794396625798415.tmp -lm

collect2.exe: error: ld returned 5 exit status

Error compiling.


During compiling the ld.exe crashes:
ld.exe has encountered a problem and needs to close.  We are sorry for the inconvenience.
(classic xp windows for crashes).

Tank you..
I still receive many crashes, but I can't understand why..
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: oldmaker on Apr 12, 2015, 07:54 pm
I pointed out the same problem in the thread "Re: IDE 1.6.1 is now available for download".
Only one sketch of mine, compiling fine with IDE 1.0.x, cannot compile with IDE 1.6.1 (always on Windows XP), interrupting with message "collect2.exe: error: ld returned 5 exit status".

The same sketch, with the same IDE, on another PC with Windows 8.1, compiles fine.

As suggested by Federico, I tried with next versions of IDE, 1.6.2 and 1.6.3, but "the song remains the same"  ;)
I also tried disabling every possible software, without success.

The verbose output of IDE 1.6.3 is in the attachment, because it's too long and the forum sw disallows me inserting it in the post.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: federicofissore on Apr 13, 2015, 08:55 am
oldmaker, this is the output of which IDE?
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: oldmaker on Apr 13, 2015, 02:46 pm
Federico, it's the verbose output of IDE 1.6.3, on Windows XP.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Protonerd on Apr 15, 2015, 07:11 pm
I pointed out the same problem in the thread "Re: IDE 1.6.1 is now available for download".
Only one sketch of mine, compiling fine with IDE 1.0.x, cannot compile with IDE 1.6.1 (always on Windows XP), interrupting with message "collect2.exe: error: ld returned 5 exit status".

The same sketch, with the same IDE, on another PC with Windows 8.1, compiles fine.

As suggested by Federico, I tried with next versions of IDE, 1.6.2 and 1.6.3, but "the song remains the same"  ;)
I also tried disabling every possible software, without success.

The verbose output of IDE 1.6.3 is in the attachment, because it's too long and the forum sw disallows me inserting it in the post.

I have the same issue with my machine running with XP, I already started another thread. johnwasser was kind to help me compile it his machine without problem which gave me an idea.
I copied the same sketch on my WIN7 machine, and there everything is OK.

So now I have the following:
1. machine running WIN XP and IDE 1.6.3 -> collect2.exe: error: ld returned 5 exit status
2. machine running WIN7 and IDE 1.6.0 -> no problem

I guess if the IDE 1.6.3 had an issue, word would be out by now. So that leaves WIN XP as the root cause. But what exactly?
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: ardukey on Apr 16, 2015, 03:26 am
Is not a problem only for IDE 1.6.3.
I upgraded my IDE for the same reason (crash ld.exe and the other erors).
hope someone che help us.

(I'm afraid about obsolescence of XP..)
Title: Re: [Work-around] many cases of ld.exe crashes. (on windows xp).
Post by: oldmaker on Apr 17, 2015, 05:43 pm
I found another sketch of mine causing the same error, but today I discovered a ridiculous work-around: adding some totally useless global variables, the two sketches compiles OK also with IDE 1.6.x on Win XP:
Code: [Select]
int y = 0;
int z = 0;
int w = 0;


The first sketch needs at least 3 additional global variables, the second at least 6.
It doesn't matter the name, the type or the values; the only requirement seems to be the number of variables added.

However I opened the issue #2989 on GitHub.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Datman on Apr 21, 2015, 02:32 pm
Hi
I have XP sp3 on two computers: a HP desktop and a Dell laptop.

I previously installed v1.6.1 on the desktop: no problems; 1.6.4: non problems.

Yesterday I updated the v1.0.5 (6?) (no problem) on the laptop to 1.6.4 (pasted from the zip):
collect2.exe: error: ld returned 5 exit status.
I've also tried a complete installation of the v1.6.3: the same error.

I have simply pasted v1.6.4 from the zip file without installing: on the desktop is OK, but on the laptop NOT.

Compiling some very simple sketches, it works.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Datman on Apr 21, 2015, 11:23 pm
Now I've tried adding variables: they have to be at least 6:

int aa;
int bb;
int cc;
int dd;
int ee;
int ff;

...but after these there are already many other similar declarations, but they don't work!... >:(
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: oldmaker on Apr 22, 2015, 07:33 pm
I found a third sketch of mine, that was ok with IDE 1.0.6, causing ld.exe crash with IDE 1.6.3.
This sketch needs at least 12  :o  additional global variables, obviously all useless.
But this illogical workaround ever works.
Pay attention to avoid variable name duplication !
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: oldmaker on Apr 23, 2015, 07:45 pm
User f41_ardu discovered another workaround for this issue: replace original file ld.exe with the file of the same name copied from the previous IDE 1.0.6.
For details see this thread: 1.6.3 ld returmed 5 exit status error with a struct in a class?  (http://forum.arduino.cc/index.php?topic=316146.0)
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: kocickamia on Apr 23, 2015, 09:43 pm
Confirm problem. In IDE 1.6.0 seems all OK, but in newer IDE (1.6.1, 1.6.3, which i tested) compile failed with "collect2.exe: error: ld returned 5 exit status" error. WinXP SP3.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Protonerd on Apr 24, 2015, 08:56 am
Thanks guys for following up on this issue, I will give the fix of f41_ardu a try, that one looks very promising!
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Protonerd on Apr 25, 2015, 06:53 pm
I can positively confirm the above described fix. Thanks a lot  :smiley-mr-green:
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Datman on Apr 29, 2015, 09:12 am
Thanks! It works!
If someone have the ld.exe crash problem, copy ld.exe from v1.0.6 to v1.6.x, nothing else. :-)
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: cdrobsonjr on May 08, 2015, 05:24 pm
WOW - really?  Several people, including myself, have experienced a problem with the loader (ld.exe) running on Windows XP, and the best we can hope for is to bring forward an older version of ld.exe from earlier builds?
Really?
How do we get the attention of the developers and maintainers to run the bug to ground and fix it?

Doug Robson - cdrobsonjr@att.net
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: nothinghere on May 21, 2015, 08:48 am
same problem here (pro mini / mega328 5V 16MHz) but swap of ld.exe definitely doesn't work for me.
Sometime it helps to "restructure" code (seperate compund operators, change sequence of operations) but trying to include Serial.print breaks compilation almost for sure.

1.6.0 doesn't work at all (compilation stops without result or error).

Only way out is to use 1.0.6 package
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: andycomic on May 26, 2015, 02:36 pm
Adding 12 extra global variable worked for me. Weirdly the id has been working fine all day but when I used three nested 'for' loops and two used the same variable by mistake, well the s*** hit the fan. Its like it just couldn't forgive me anymore.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: orak59 on May 26, 2015, 05:19 pm
After downloading 1.6.4 I was having numerous crashes (collect2.exe: error: ld returned 5 exit status) with even the simplest of sketches, I copied the ld.exe from 1.0.5 into the latest 1.6.4 download, and everything now works great!  I used 1.0.5 instead of the previously mentioned 1.0.6, because I already had it downloaded. Using Windows XP SP3.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: edawson on May 28, 2015, 01:06 am
//thanks the idea appears to work
//I add the following global variable
long xxxx[0]; // added to eliminate ID.exe crashes
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: edawson on May 28, 2015, 01:09 am
// add a global variable
long xxxx[0]; //Added to eliminate ID.exe crashes
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: nothinghere on Jun 01, 2015, 08:29 am
finally I found out that I was repeatedly replacing the wrong ld.exe. Did a "Installer" install to D: in the beginning (but didn't recognize that compiler & co ended up in my userprofile) later replaced D:\arduino with .zip version where I tried to replace several ld.exe for no avail. Now in the correct place it seems to work.

Going to clean up the mess and never touch that "installer" stuff again.

P.S.: the trick with adding global variables never worked for me. A method to break compiling for ~100% was adding serial output. Sometimes serial.print was ok in the setup but definitely broke it in loop.
It is very discouraging if you start something new and already fail with the examples ...
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: hakanArduino on Jun 05, 2015, 06:05 am
First time I had the problem I fixed it by replacing ld.exe from an older version - thanks to you guys.

Then I messed up my installation by installing MegunoLink's Upload Monitor. If you are using MegunoLink and started to get a bunch of "not valid win32 app" errors, close the IDE and remove that Upload Monitor thing using MegunoLink's menus.

Back to the issue. Today I tried the "ld.exe" from the latest nightly build at the download page and it worked! Unless I mixed up files, devs must have fixed the problem. Can someone try to verify this?

Cheers!

PS: that's "LD.EXE" not "ID.EXE". Don't make the mistake I made.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Danny_v on Jun 11, 2015, 05:17 pm
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 (http://forum.arduino.cc/index.php?topic=310950.msg2272209#msg2272209)

Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: TMRTMR on Jun 14, 2015, 02:37 am
Just a quick note: On a Windows XP SP3 box, with 1.6.4, their "Buttons" example (for example) blows up. Following suggestions here, I put 9 "int" declarations before the setup()  and it now compiles fine. (Go iigure).

TMRTMR
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: auger-f on Jun 15, 2015, 10:13 pm
Is this problem solved with the new arduino IDE 1.6.5 ?
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: kingbeetle66 on Jun 16, 2015, 03:01 am
Is this problem solved with the new arduino IDE 1.6.5 ?
Nope.  I just downloaded 1.6.5 and the issue continues..
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: federicofissore on Jun 16, 2015, 07:30 am
I had the chance to use a clean windows xp and, sorry to say, the IDE works just fine. A similar issue has been affecting a windows 8 user: cause was her antivirus, that was blocking access to some files shipped and used with the IDE. Can you double check your quarantine or something?
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: auger-f on Jun 16, 2015, 08:55 am
Is this problem solved with the new 1.6.5 IDE ?
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: nothinghere on Jun 16, 2015, 12:29 pm
definitely NO
and I tried with a fresh install of XP/SP3. It seems to depend on a lot of things.
I had an example where it wouldn't accept a modulo operator until I swaped two statements some lines above. It then compiled ok until I inserted serial.print() in the mainloop, that broke it for good;, I didn't find a way around swaping ld.exe.
And that makes it stable - what to me shows that its definitely some flaw in the newer toolchain.

And - as sidenote - the IDE itself isn't really stable on W7 either. When I leave it open in the background it sometimes disappears on its own, without any further notice ... if you look at the taskmanager you see the javaw gobbling up memory and probably running out of eventually ....
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: SOONER49 on Jul 10, 2015, 03:18 am
Id crashes.
I have through many post about this error and am still puzzled. I have received the message many times, not just in any one  sketch.  Many of the times have been when I tried to compile a sketch copied from the web with no changes.  Someone suggested adding variables into the sketch, no such luck. Instead of the connect2.. message now I am receiving the following error message from the windows operating system.
example one
AppName: ld.exe    AppVer: 0.0.0.0    ModName: ld.exe
ModVer: 0.0.0.0    Offset: 0008293b

If I open error report, it will not allow me to copy it but I believe is a key part is
Module 1
id.exe
image base 0x00400000 image size0x00000000
checksum 0x0011011ee time stamp 0xffffffff
version information
signature   00000000
strucVer 00000000
file ver(0.0:0.0)
prod ver(0.0.0.0)
flag mask flags,os: and file type are all listed as 00000000
I hope this will help someone  who knows more than fix this issue.
One more not of interest.  I did several searches and could not fine id.exe on my xp sp3 machine
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: john1993 on Jul 10, 2015, 07:20 am
no it is not solved. in fact worse. and imo it is foolish to be concerned with coding details. i struggled for couple hours today with it in this thread:  http://forum.arduino.cc/index.php?topic=334994.0

i say worse because the standard fix of simply copying ld.exe from any earlier version is more tricky. from 1.5.8 and some others worked for 1.6.3 but not for 1.6.5. from 1.0.5 did. several projects that misbehaved before are ok now.

btw if windows search does not find it then probably being used incorrectly. mine came up with over 30 instances. i got half way through that list before finding the one (1.0.5) that fixed it.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: nothinghere on Jul 10, 2015, 09:05 am
Hi,
you have to look for LD.exe - windows doesn't care for upper/lower case, but for difference between l (lowercase L) and I (uppercase i)! (ha, different fonts for writing/display of posts are a "pita")

To find the one giving you the headache, go into File/preferences and tick "Show verbose output during:" x compilation.
In the message window you will see the compilation process and some lines before the error the call of ld.exe with the relevant path. This is the ld.exe you want to swap for an older one.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: nilton61 on Jul 10, 2015, 06:21 pm
Is this problem solved with the new arduino IDE 1.6.5 ?
Issue continues when having Serial.print
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Vanbccan on Aug 25, 2015, 05:06 pm
I came to the forum today in search of a solution for the same problem that I see many other people are having - compiling with version 1.6.5 r2 for Uno on Windows xp:

The issue of the error happens (in my case) only when Serial.println is used. The code compiles fine if I use Serial.print (without the ln).
This bug was not there a couple of days ago (it seems)... as all my files were compiling just fine (but then - I was most often compiling for the Teensy 3.0) ... including files with Serial.println.  Suddenly the error occurred when I added Serial.println to a file.  I note that I had also switched over to the Uno at some stage.
So... if I remove the ln from Serial.println the file will compile and upload.
However it seems to me that I have other files that do (or did) compile with the Serial.println ... and as this is a new error that was not occurring previously I am wondering what exactly is triggering the issue.

I wonder if it has to do with the character set interpretation from keyboard settings.
I once saw a similar issue with a program that was misinterpreting an apostrophe mark where my keyboard was capable of producing two similar marks... a vertical apostrophe ( ' ) and a slightly slanted apostrophe (that may have been part of a foreign character set).  Note: The fact that the code compiles using some of the solutions mentioned below may weed this out as a cause for the problem.

I tried swapping out the ld.exe for version 1.5.8 (which I already had on my computer) and this did not work for me.  I see reference here that I need to test specific versions of ld.exe and I will look into that.

I am hoping that someone has now come up with a more permanent and uptodate fix for this.

Thanks

Update:
More interesting tests.
Uno: Serial.println("test") - will not verify
Uno: Serial.print('\n') - will not verify

Switching to board Arduino Micro - both tests above will verify (compile).

Something going on here with the Uno version that inhibits code which produces new lines in Serial.print.

Update 2:
Based on some tips/tests found in the forum on the same issue I added a dud variable to the top of my code: int test=1; (int test;  or  String abc; will also work) and suddenly my files with Serial.println ( or Serial.print ('\n'); ) will verify/compile.

This is a strange issue indeed.  Someone here must know why these little tricks/tests such as adding dud variables will suddenly allow the code to compile.  It seems there is a balance... when the code stops compiling (others mention) you must continue to add more dud variables.  Is there a size of file/memory issue that needs to fall on just the right mark/division/ratio for the code to compile?

Update 3
As my code length grew and I included more Serial.println I also had to add more dud variables:
Code using 25 Serial.println required 12 dud variables... int dud; int dud5; ... int dud12; 
At some points removing variables also worked so I often tried that first.
What most often worked (and to save time) I simply just kept adding a variable until my code would compile.
It is a strange balancing act and I am sure someone here can add up these clues to figure out what the problem is and what a better solution would be.

How do I/we get some attention on this issue?
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: nerobotas on Sep 11, 2015, 06:36 pm
Is this problem solved with the new 1.6.5 IDE ?
Tried today 1.6.5, after upgrading from formely fixed the same way 1.6.3 - same problem (WinXP machine). Eg. FastLed examples compiles, works, but add any global variable (int, byte, volatile or not) - ld.exe crash'es. Local variables in functions works fine. Copied ld.exe and some missing cygwin libraries from 1.6.0 distribution (simply run ld.exe and see what required), and everything works again.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Osiris on Oct 10, 2015, 12:17 pm
I just upgraded from 1.6.3 to 1.6.5 yesterday. I want to try someone's posted example code and kept getting this error. I tried modifying it a bit with no luck. I deleted the delay(10); line and the code uploaded successfully.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Shanjaq on Oct 12, 2015, 09:47 am
Same problem here.  WinXP SP3, ld.exe "has encountered a problem" and crashes while compiling a simple SoftwareSerial passthrough sketch.  Can someone PLEASE fix this?

Code: [Select]

/*
  Example Bluetooth Serial Passthrough Sketch
 by: Jim Lindblom
 SparkFun Electronics
 date: February 26, 2013
 license: Public domain

 This example sketch converts an RN-42 bluetooth module to
 communicate at 9600 bps (from 115200), and passes any serial
 data between Serial Monitor and bluetooth module.
 */
#include <SoftwareSerial.h> 

int bluetoothTx = 2;  // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 3;  // RX-I pin of bluetooth mate, Arduino D3

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()
{
  Serial.begin(9600);  // Begin the serial monitor at 9600bps

  bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
  bluetooth.print("$");  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");  // Enter command mode
  delay(100);  // Short delay, wait for the Mate to send back CMD
  bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  bluetooth.begin(9600);  // Start bluetooth serial at 9600
}

void loop()
{
  if(bluetooth.available())  // If the bluetooth sent any characters
  {
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read()); 
  }
  if(Serial.available())  // If stuff was typed in the serial monitor
  {
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
  }
  // and loop forever and ever!
}
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Osiris on Oct 13, 2015, 11:38 am
Same problem here.  WinXP SP3, ld.exe "has encountered a problem" and crashes while compiling a simple SoftwareSerial passthrough sketch.  Can someone PLEASE fix this?
There's nothing wrong with the code, per se, and I don't want to say the cause is universal but I tried what worked for me on your code and it worked. I took out the delay(100); (just by even commenting it out) and the code compiled.

You may need another workaround for that short delay.

I tried creating a variable instead and put that into the delay(); function but it still crashed.

However, the Blink Sketch still compiles fine (so it's not the delay(); function itself).
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: arossini on Oct 19, 2015, 02:16 am
Same problem here. This is the Sketch for testing only.
Until line 96, OK. If add line 97 crashed.
Ide 1.6.5 updated today. XP SP3.

int a;
int b;
int c;
int d;
int e;
int f;

void setup() {
Serial.begin(9600);
Serial.println(a);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(a);
Serial.println(b);
Serial.println(c);
Serial.println(d);
Serial.println(e);
Serial.println(f);
Serial.println(f);   // Line 96
//Serial.println(f); // Line 97
}  // FIN del void setup()

void loop()
{
delay(100);
}
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: arossini on Oct 19, 2015, 07:22 pm
I could solve the problem with the following procedure:
1) Dowload from:    https://www.arduino.cc/en/Main/OldSoftwareReleases#1.0.x, the version 1.05 for windows. Is not the windows installer (EXE). Is a file zip.
2) in C:\Archivos de programa\Arduino\hardware\tools\avr\avr\bin\ , change extension a ld.exe to ld.exe1.
3) From file.ZIP, copy file ld.exe to C:\Archivos de programa\Arduino\hardware\tools\avr\avr\bin\
No more.
All work OK.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: nilton61 on Oct 19, 2015, 08:56 pm
One of the things that made arduino atractive was the simplicity and robustness of the IDE.
Since that is completely fubar now i have stopped using arduinos. I rather go through the trouble of using atmel studio than having to wrestle with these issues
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: SalvatoreBTS on Oct 29, 2015, 12:09 am
I used the IDE version 1-0-5 and everything worked, now I switched to version 1-6-5 and gives me error id.exe. I replaced the file with the id.exe file in the 1-0-5 and keeps giving me error. I noticed is the function " delay (xxx);" to create the problem, by removing that function from sketch the compilation comes at the end perfectly.
This is a serious problem that must be resolved immediately, otherwise you can't use version 1-6-5 on XP  :( 

apdate > downloaded 1-6-5 zip file, unzipped into another folder (not installed ) , I loaded the same sketch through software in the folder and it works perfectly !! :O why this occurs?  ???   
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: hieberjohn on Jan 01, 2016, 12:13 am
I find the version 1.6.7 has this problem using Board: ARDUINO/GENUINO UNO hosted on Win XP SP3.  I find that  by adding global "dummy" unused char variables at the beginning of a sketch the error happen depending on the number added.  I kept adding variable until a clean compile resulted.

For Example: char dum1,dum2,dum3,dum4; compiled ok but char dum1,dum2; cause the "compilation error".
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: hmjswt on Jan 09, 2016, 10:39 am
Hallo,

I have 3 computers running 1.6.7.
Only one was giving compile errors.
Replaced ld.exe with the 1.0.5 version.
Now is compiling perfectly.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: mcdonald_ajr on Feb 04, 2016, 03:08 pm
This still seems to be a problem.
I installed the IDE 1.6.7 onto my Windows XP laptop yesterday and now have this problem.

 Any idea when we might see a new release that fixes this issue?
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: chicago on Feb 16, 2016, 07:08 pm
I was also getting crashes of LD.EXE on XPSP3, just after upgrading from 1.0.2 to 1.6.7.  

I think I may have discovered a workable solution that stops the crashes and seems to make everything normal again.  And it's nice and simple.  I hope it works for others.

I located the LD.exe that was crashing (using a search)--I had two ld.exe files--one that came with 1.0.2 and one that came with 1.6.7.  I clicked on the offending LD.exe (mine was located in Program Files/Arduino/hardware/tools/avr/avr/bin) and select properties, then compatibility, and check "Run in compatibility mode", select "Windows 98 / Windows ME", and click apply.

For me, doing this instantly stopped the LD.EXE crashing.  I'm not sure exactly why, maybe some smart geeks here can explain the "Why".

The next step is to see if it works for others.

N
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: Ovey on Feb 17, 2016, 06:11 pm
Works for me!

I've just setup an old PC with Windows XP SP3 and installed the latest Arduino IDE
Standard Arduino Uno programming was fine. Trinket had the ld.exe error.

Followed tip from chicago and all good now.
Many thanks.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: xl97 on Mar 16, 2016, 04:56 pm
I agree.

@chicago's solution of setting LD.exe to run in Win 98 compatibility mode worked for me we well

* no swapping of ld.exe files
* no code 'tweaking'
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: wucharinton on Apr 21, 2016, 04:27 pm
I had the same issue both id.exe return error and collect2.exe with IDE 1.6.1 or higher on Windows XP. but it still work fine with IDE 1.5.8 and 1.6.0.

I though the new software has no longer support XP . I then switch to Win 7 32 bits with Arduino IDE 1.6.1 to 1.6.5, problem is gone. I don't want to use IDE 1.6.0 or lower since i used new EEPROM.h with IDE 1.6.5

I have tried to replace 1.6.5 with 1.0.5, it totally was stupidity to solve the problem and wasted time. it was seemly to be okay but  when i have tried to compile complex source code. The problem remains!!!
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: pert on Apr 22, 2016, 12:04 am
I don't want to use IDE 1.6.0 or lower since i used new EEPROM.h with IDE 1.6.5
I think it's best to get a more recent version of the Arduino IDE working for you but if you are forced to use the old IDE version you can still use the new EEPROM 2.0 library included with recent versions of the Arduino IDE because it is backwards compatible. Just replace the libraries\EEPROM folder in the old IDE version with the one from Arduino IDE 1.6.5.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: andersmmg on May 17, 2016, 12:06 am
I was also getting crashes of LD.EXE on XPSP3, just after upgrading from 1.0.2 to 1.6.7.  

I think I may have discovered a workable solution that stops the crashes and seems to make everything normal again.  And it's nice and simple.  I hope it works for others.

I located the LD.exe that was crashing (using a search)--I had two ld.exe files--one that came with 1.0.2 and one that came with 1.6.7.  I clicked on the offending LD.exe (mine was located in Program Files/Arduino/hardware/tools/avr/avr/bin) and select properties, then compatibility, and check "Run in compatibility mode", select "Windows 98 / Windows ME", and click apply.
Yup! This worked for me great! I had been stressing over it for a while, but of course it's as simple as this to fix.

I'm not sure exactly why, maybe some smart geeks here can explain the "Why".
This method works because the Windows XP OS uses very different standards for executables from ME and 98, so the error would have been in the standards in validation of the code. If you don't understand that, just ignore it. It's not really important.  ;)
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: namircs on Jul 27, 2016, 08:58 pm
I have a laptop with Win XP and I Update the (IDE) program arduino and trying to compile my sketch began to mark the error:
collect2.exe: error: ld returned 5 exit statusexit status 1Error compilaciĆ³n en tarjeta Arduino/Genuino Uno.

Reviewing forums indicate problems due to the change of technology, because it has the following:
If the sketch is compiled into Win XP   -->  Marks the error.
If the sketch is compiled in Win 8        -->  NO marks the error.


Run the following procedure to correct the problem:

1. I downloaded and installed the latest version of arduino (IDE).
   Rename the file:
   C:\Archivos de programa\Arduino\hardware\tools\avr\avr\bin\ld.exe
   As:
   C:\Archivos de programa\Arduino\hardware\tools\avr\avr\bin\ld_ORIGINAL.exe

2. I downloaded  1.0.5-r2 arduino IDE   
   (arduino-1.0.5-r2-windows.zip, https://www.arduino.cc/en/Main/OldSoftwareReleases#previous) 
   And extracts the file:
   arduino-1.0.5-r2-windows.zip\arduino-1.0.5-r2\hardware\tools\avr\avr\bin\ld.exe
   This file is copied as:
   C: \ Program Files\Arduino\hardware\tools\avr\ avr\bin\ ld.exe

Following this procedure when compiling the error no longer appears.  :)

Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: zoomx on Jul 28, 2016, 02:23 pm
Which IDE? Because it seems that your trick doesn't work with IDE 1.6.10.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: hiduino on Jul 30, 2016, 03:59 am
Which IDE? Because it seems that your trick doesn't work with IDE 1.6.10.

I had to update several locations for IDE 1.6.10 depending on which board type you select.

Code: [Select]
\arduino-1.6.10\hardware\tools\avr\avr\bin
Code: [Select]
\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\bin
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: brice3010 on Dec 19, 2016, 08:34 am
I installed Arduino 1.6.12 on a Windows XP machine after succesfull use on W7 (64 and 32bit) and W8.1 (64bit).

Error ld ext status 1 on some of my sketches used succesfully elsewhere.

Downloaded 1.0.3 and copied ld.exe from this folder to the 1.6.12 folder where I had changed ld.exe and ld.bfd.exe to "old" versions.

No succes.

Then I ran 1.0.3 version and updated boards in boards manager.

No succes.

Then I ran 1.6.12 version, updated boards in boards manager.

Bingo!!

I do not know what exactly went on but I think that the ld.exe copy trick is the root of the solution. However, you have to run some board update sessions too before it works (in my case anyway).

Thank you for all the posters showing the way here.

Edit following next post by pert: I made a mistake writing version type: it was not version 1.0.3 that I ran first instance but 1.6.12
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: pert on Dec 19, 2016, 09:07 am
Then I ran 1.0.3 version and updated boards in boards manager.
Arduino IDE 1.0.3 doesn't have Boards Manager.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: brice3010 on Dec 19, 2016, 10:39 am
Arduino IDE 1.0.3 doesn't have Boards Manager.
Strange, I surely ran boards manager. Probably I must not have ran 1.0.3 but the 1.6.12 the first instance.

Edit 28/12/2016: issue still present. Not solved.
Title: Re: many cases of ld.exe crashes. (on windows xp).
Post by: brice3010 on Dec 19, 2016, 10:43 am
Strange, I surely ran boards manager. Probably I must not have ran 1.0.3 but the 1.6.12 the first instance.

I checked again, indeed it was not 1.0.3 that I ran first after copying the ld.exe but the 1.6.12 version.

I will edit my initial post and mention my mistake.