I post this message as a hint for all the people complaining about
Bad value collect2: ld returned 1 exit status
and never got any answer (you can see LOTS of 1-message threads). I
also had it, it comes alone, no other complaint about headers or TOC
or symbols or whatever. -Wall or anything show no errors at all, ld
just fails and that's it.
My situation was: I copied by mistake on that Linux machine a Solaris
library ld used later for linking... so I would still call that a
problem of the linker which was obviously unable to figure out its
about another platform binary file, or at least give an understandable
error message. So guys check all your libraries to see if they are
really what they are supposed to be.