Centos

安裝 glibc-devel.i686 後沒有 32 開發庫錯誤

  • April 24, 2015

我正在嘗試在 centOS 6 上安裝 gcc 4.9.0。在此期間./configure出現錯誤:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-   linux/4.4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
configure: error: I suspect your system does not have 32-bit developement libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.

我搜尋了一個答案,發現這個錯誤應該通過安裝glibc-devel.i686包來解決。

但是,即使在我使用yum. 有任何想法嗎?

比@Miroslav 回答更明確一點:

1依賴項

#64-bit (`x86_64`) C library and headers
yum install libgcc
yum install glibc-devel

# 32-bit (‘i386’) C library and headers
yum install libgcc.i686
yum install glibc-devel.i686

在GCC Prerequesites中查看所有這些。

2然後編譯--enable-multilib

../configure --enable-languages=all --prefix=/usr/local/gcc --enable-multilib

編輯。

**旁注:**不要在同一目錄中編譯,正如我./configure在您的範例中看到的那樣。請參閱安裝 GCC

不要執行./configure,不支持這個,你需要從源目錄之外執行configure

引用自:https://unix.stackexchange.com/questions/140280