1. 程式人生 > >configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.

configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.

div gif mpfr nbsp sting .gz 依賴 alt 命令

configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.


一、錯誤發生情景:

  在安裝gcc時,執行.configure命令,報以下錯誤:

技術分享圖片
...省略
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.
技術分享圖片

二、錯誤原因:

  錯誤信息中說明,安裝gcc需要這三個依賴:GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+。


三、解決問題:

  錯誤信息,提示了下載頁面的地址:ftp://gcc.gnu.org/pub/gcc/infrastructure/。

  所以去下載相應的包,進行安裝。

  1、打開鏈接:ftp://gcc.gnu.org/pub/gcc/infrastructure/。

  2、找到需要的三個包地址,下載下來:

      wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2

      wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2

      wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz

  3、安裝GMP:      

tar -jxvf gmp-6.1.0.tar.bz2
cd gmp-6.1.0
./configure
make && make install

  4、安裝MPFR:

tar -jxvf mpfr-3.1.4.tar.bz2
cd mpfr-3.1.4
./configure
make && make install

  5、安裝MPC: 

tar -zxvf mpc-1.0.3.tar.gz
cd mpc-1.0.3
./configure
make && make install

configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.