View Full Version : Compile errors (...ld returned 1 exit status)

September 10th, 2012, 03:14 PM
It seems I've messed up my compiler library and thus cannot compile anything. I end up with:

/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: ld returned 1 exit status

when trying. This may have happened when I configured an AVR tool chain but I'm not sure, something I need to take a little more time over next time, me being new to linux, and newer yet to compiling for source. Upon logging in, my default PATH is:


I don't know where lightdm came from and I thought this was the problem and have tried to grep for entries with nothing coming back. I've removed it per session but this does not change anything when I try to compile, anything (e.g. hello.c). Errors from various source packages include recurring errors like:

configure:3498: gcc -V >&5
gcc: error: unrecognized option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3509: $? = 4
configure:3498: gcc -qversion >&5
gcc: error: unrecognized option '-qversion'
gcc: fatal error: no input files

I've been scouring for a solution but don't really have the knowledge to work it out...I hope someone can help.

I have gcc, g++, and other libraries required to compile but it seems that there's a missing link...

#gcc -v:


September 10th, 2012, 04:06 PM
Moved to Packaging and Compiling Programs.

September 10th, 2012, 09:02 PM
Sorry for the mistake, and thanks for moving

September 13th, 2012, 04:15 AM
I changed my post quite a bit after doing a bit of digging. Bump!

September 13th, 2012, 04:57 AM
How did you wind up with ld being located in /usr/local/bin? Is that something you put together or was that the default? The first thing that caught my eye when reading your post is this --> "This may have happened when I configured an AVR tool chain". Can you tell us or link us to how you did this? It may help for other people viewing this post.

September 13th, 2012, 11:03 AM
The guide is below for reference but tbh, but I don't think that guide will indicate anything to do with my problem. That's just the last process of events I remember being able to compile successfuly. I remember mingw being a pain to configure, which if I remember rightly, was an offshoot of this process.


I've made tarballs of root every few days since installation if they're any use here.

September 13th, 2012, 05:42 PM
Do you have more than one ld installed? Is ld also at "/usr/bin/ld" or similar? If you export your $PATH to not include "/usr/local/bin" temporarily does your program compile? Just a shot in the dark but this is some stuff I would take a look at

September 14th, 2012, 07:09 PM
Thanks for the tips. I have:




Things remain the same when excluding /usr/local/bin

my ldconfig:


if test $# = 0 \
&& test x"$LDCONFIG_NOTRIGGER" = x \
&& dpkg-trigger --check-supported 2>/dev/null \
&& dpkg --compare-versions "$DPKG_RUNNING_VERSION" ge '1.14.5ubuntu10~~'
if dpkg-trigger --no-await ldconfig; then
if test x"$LDCONFIG_TRIGGER_DEBUG" != x; then
echo "ldconfig: wrapper deferring update (trigger activated)"
exit 0

exec /sbin/ldconfig.real "$@"

September 14th, 2012, 08:57 PM
Other than rebuilding everything I do not know. Wish I could help more but this is over my head for now

September 14th, 2012, 09:56 PM
Ah no worries man, thanks for trying anyway. I'm just glad I learned how to automate tar, back to the clock :)

And I think the next trick would be keeping the toolchains seperated somehow. I remember talk of such things, somewhere out there. Perhaps logging all my terminal input would be an idea too, for future fumble.