Declaration of variables

I have copied a scetch for the ESP8266 from the Internet , compiled and used it . OK everything is fine . But when I want to develop it on my own , the compilation fails when simply changing the variable "int x" to "long x;" , and the compilator returns the message

"collect2.exe: error: ld returned 5 exit status .

exit status 1
Error compiling for board Arduino/Genuino Uno."

Cannot see any wrong in that ...

Hi,

Can you please post a copy of your sketch, using code tags?

What Arduino board.
What version IDE?
What OS are you running?

Thanks..... Tom.... :slight_smile:

Cannot see any wrong in that ...

and we can't see any code so please post it so that we can see exactly what you have done.

Is that the complete error message ? If not then please post that too.

KalleL:
"collect2.exe: error: ld returned 5 exit status .

exit status 1
Error compiling for board Arduino/Genuino Uno."

Let me guess. You are using Windows XP?

johnwasser:
Let me guess. You are using Windows XP?

That was my guess too, when I saw that particular error message.

@KalleL , if you are using a Windows XP machine, take a look here:- many cases of ld.exe crashes. (on windows xp)
(The fix that involves using an early version of "ld.exe" from IDE V1.0.6 works fine, or at least it did for me when I was still using WinXP.)

Thanks OldSteve

This tip did the trick :)!

I am effectly using an old PC with Windows XP , but it has worked fine for
a long time and with scores f applications . But now I downloaded the IDE 1.6.11
and then the problems started ... This version though when installing checks the
prsence of older IDE:s and then erases it/them ... so , fortunately I had another
PC with 1.6.8 installed ... copied that LD.exe and ,...Yuipee!!!

But I must admit I am surprised the Arduino software people have let through a
bug like that ...

KalleL:
But I must admit I am surprised the Arduino software people have let through a
bug like that ...

Really? Even Microsoft has not supported Windows XP for more than two years:
"After 12 years, support for Windows XP ended April 8, 2014"

Why should Arduino spend time and money testing and supporting the IDE on an unsupported OS? If you want Windows XP support you could always try the last released version from before Windows XP was put out to pasture: ARDUINO 1.0.5-r2 (2014.01.08). If you don't mind running beta-test software you could use ARDUINO 1.5.6 BETA (2014.02.20).
Also, the change is in the linker which is not something Arduino develops. They just occasionally include the latest version in a release to get the benefit of bug fixes and new features.

Agree with John, the time of XP is over. You don't expect a DOS program from 1994 to work out of the box, do you?

KalleL:
fortunately I had another PC with 1.6.8 installed

Nothing really fortunate about it. You can just download every version of the IDE you like straight from arduino.cc :wink:

You don't expect a DOS program from 1994 to work out of the box, do you?

Why not? If not feasible, I would vote for a Commodore 64 version :sunglasses:

Every try running some older games on a new PC? Some of them run really fast! As the hardware is much faster now and the inherent delays of the old hardware that made the game playable are no longer there.

rpt007:
Why not? If not feasible, I would vote for a Commodore 64 version :sunglasses:

Although it might run it would be foolish to assume it does. :wink: Same goes for Win XP now.

Cristian Maglie's(one of the lead Arduino developers) comment on the GitHub issue indicates that this is something the Arduino developers are interested in fixing but he can't reproduce the issue:

I don't think it's a high priority but it sounds like if someone would point them in the right direction the developers would probably have a try at a fix. It may end up that the fix would need to be made upstream.

Interestingly, the comment from the Arduino webmaster indicates that they would also like Create, the web IDE, to support XP:

pert:
I don't think it's a high priority but it sounds like if someone would point them in the right direction the developers would probably have a try at a fix.

It's not easy to point them in the right direction. It's sooo hard to pin down. It struck me out of the blue when I was still using XP, for no apparent reason. And look at all the weird and wonderful fixes that have worked for different people.

Interestingly, the comment from the Arduino webmaster indicates that they would also like Create, the web IDE, to support XP:

I can understand this. A great many people still use XP. Not everyone can afford a newer OS, and often even if they could, that also means a new(er) PC to support it. I stuck with XP for that reason - my old machine couldn't run a newer OS, except maybe Vista, and that wasn't an option for me. I would almost have preferred going without. :smiley: (A Win7 compatibility check gave me a 'thumbs-down'.)

Yup - XP is simply not supported anymore, and that's how it is. Why not get a Mac?

CrossRoads:
Every try running some older games on a new PC? Some of them run really fast! As the hardware is much faster now and the inherent delays of the old hardware that made the game playable are no longer there.

You can always underclock your PC :smiley: It was a lot easier 25 years ago; just press the turbo button to clock down to 4.77 MHz (or so).

OldSteve:
my old machine couldn't run a newer OS, except maybe Vista

That's a bit of a weird statement. :smiley: Windows Vista was pretty bloated, Windows 7 runs wayyyyyy lighter. And those Win compatibility checks are not worth much. They always tell "Computer says noooooo" if the PC is more then 2 year old. But if a PC was fine running Win XP it's fine running Win 7 as well. Only really weird hardware like Creative Sound Blasters are not always working fine.

AS for me, I run Windows 10 just fine on a machine that came out together with Vista :stuck_out_tongue:

septillion:
That's a bit of a weird statement. :smiley: Windows Vista was pretty bloated, Windows 7 runs wayyyyyy lighter. And those Win compatibility checks are not worth much. They always tell "Computer says noooooo" if the PC is more then 2 year old. But if a PC was fine running Win XP it's fine running Win 7 as well. Only really weird hardware like Creative Sound Blasters are not always working fine.

AS for me, I run Windows 10 just fine on a machine that came out together with Vista :stuck_out_tongue:

I mentioned only the compatibility check to be brief.
I wasn't aware that those compatibility checks should just be ignored, and didn't want to upset the apple cart just to find out that it was right. But also, I have a very old printer that I still like to use, but can't get drivers to suit Win7 and later. There might have been other issues, too. I can't remember. That was some time ago now.
There are also software issues with later versions of the OS. I have some pretty old stuff that works fine on XP, but not on later versions. I didn't go into full detail in my reply in this thread because it wasn't relevant.
And I'm surprised that you feel that this is important enough to dredge up.

Hehe, sorry :smiley: Just found it kind of funny enough to reply :smiley: