Linker Error: gcc

I get this error every time compiling programs, setting up and installing some things like binutils, textinfo, etc.

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

I want to know about it. When will it come and what will be the actual problem, and also how to solve it?

+7
source share
2 answers

Try using gcc with the following option: gcc --sysroot=/usr/local

But as others in the comments said, do not try to spoil your system with critical packages such as binutils , unless you know what you are doing.

+2
source

If you tried to install a version of binutils that should work just like in /usr/bin , you should know that

  • gcc calls ld with the option --sysroot=/ .
  • ld binutils, built from a source with default options, rejects the --sysroot .
  • A --sysroot option will only be accepted by ld if binutils has been configured with the --with-sysroot .

So, to cover this use case, configure binutils with the option --with-sysroot=/ .

+2
source

All Articles