Linker Problem

GDay

I am having problems with ld (using IDE 1.6.12) collect2. says error 5 and that is all info I can get. not very helpful.

Interesting point: My sketch was built properly all the time. then I updated some boards as suggested by the IDE and then this error came up. no changes in the sketch itself at all.

I looked around in the temp build directory but could not find any linker output file. Is there a way to tell the linker to write such file or the build process not to delet this file ? I guess there must have been a file once that collect2 was able to scan through.

any idea appreciated. tia

We really need more info. Go to File → Preferences and click on the Compile and Upload check boxes so you get more info on the error. The cut-and-paste that info here.

thanx econjack,

build output attached.

build_output.txt (15.9 KB)

additionally info:

I’ve been working with C and embedded C for about 3 decades. Just new to the Arduino world :wink:
So I think if I could inspect the intermediate & output files, they’d help me a lot.

meanwhile I fooled around a bit with the project.
commenting stuff in and commenting out, the usual.

got one function in the sketch called

void output_time(void)
{
bla bla
}

it is the very first code fragment within the source file

if I remove the call to this function from the sketch, the project binds properly.
no matter, if the function has a prototype or not …

isn’t that weird ?
and, especially if you keep in mind that the entire sketch built well prior to the board update.

thanks again for illumination ;))

GOT IT:

it's a call to sprintf. that call compiled (and bound) well with old board files

again: the main question for me as user with enough experience: how can I inspect the compiler and linker files to get more info than just "ERROR"

a larger project than this might have made me go crazy.

analox: it's a call to sprintf.

Nope.

https://www.google.com/search?q=collect2.+says+error+5

https://github.com/arduino/Arduino/issues/2989

Are you using Windows XP?

Yep, this definitely sounds like the Windows XP bug in ver 1.6.12. The error almost seems to come and go at random with small changes in the source code.

Possible solutions.

  1. Go back to an older version of the IDE. Many people (self included) have solved the problem by going back to ver 1.0.6

  2. At least one person has reported fixing the problem by downloading a newer version. Unfortunately I guess it has to be "just the right" newer version. I tried a newer "nightly build" a few weeks ago and it didn't even open on my computer.

  3. This one is what I'm currently doing.

a) Right click on the IDE shortcut and select properties. Then set it for compatibility mode for windows 2000

b) Find the loader exe (in .\hardware\tools\avr\avr\bin) and do the same thing with 2k compatibility mode for the file LD.exe

c) Make a temp folder with a short path, like "c:\temp" for example. Then open preferences (File-Preferences) in the IDE, and click on the link to file preferences.txt at the bottom of the page to open it. Finally add the line "build.path=c:\temp" to the preference file and save it. (Hint: You may need to close the IDE before saving).

TBH I'm not sure if just step "a" and "b" are required, or even if step "c" is enough by itself. The errors were too random for me to be certain. However, after doing "a" "b" and "c" I've not had the problem again with 1.6.1.2

thanks Coding Badly & Stuart for pointing to that.

Indeed it is an XP machine (as I am no fan of Java, I used an old VM that already had Java and that is XP)

Funnily after replacing sprintf by a "handmade formatted output" it all binds well. (with the buggy IDE version) but ok, will go back to older version. thanks again.

but:

assume having a problem like an unresolved external the question remains: how can I see inside all the output files ?

byee ...