簡體   English   中英

鏈接器錯誤:gcc

[英]Linker Error : gcc

我每次都會收到此錯誤,同時編譯程序,配置和安裝
像binutils,textinfo等一些東西。

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

我想清楚地知道這一點。 何時會到來,實際問題是什么,以及如何解決?

如果您嘗試安裝的binutils版本應該與/usr/bin ,那么您應該知道

  • gcc使用--sysroot=/選項調用ld。
  • 使用默認選項從源構建的ld of binutils拒絕--sysroot選項。
  • 如果binutils配置了選項--with-sysroot --sysroot則只有ld可以接受--sysroot選項。

因此,要覆蓋此用例,請使用選項--with-sysroot=/配置binutils。

嘗試使用以下選項使用gcc: gcc --sysroot=/usr/local

但是,正如其他人在評論中告訴你的那樣,不要試圖用像binutils這樣的關鍵軟件包來破壞你的系統,除非你知道自己在做什么。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM