Linker Error : gcc

社会主义新天地 提交于 2019-12-01 02:09:00

问题


I am getting this error every time, while compiling programs, configuring 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 clearly about this. When will will come and what is the actual problem, and also how to solve it?


回答1:


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

But, as the others told you in the comments, don't try to mess your system with critical packages such as the binutils, except if you know what you are doing.




回答2:


If you were attempting to install a version of binutils that should work alike the one found in /usr/bin, you should know that

  • gcc invokes ld with a --sysroot=/ option.
  • ld of binutils built from source with the default options rejects a --sysroot option.
  • A --sysroot option will only be accepted by ld if binutils was configured with option --with-sysroot.

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



来源:https://stackoverflow.com/questions/16437383/linker-error-gcc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!