gcc 4.4.6安装

1/ 下载源码:
https://ftp.gnu.org/gnu/gcc/gcc-4.4.6/

 

2/ 安装:

tar -zxvf gcc-4.4.6.tar.gz
mkdir /usr/bin/gcc-4.4.6
cd ./gcc-4.4.6
./configure --prefix=/usr/bin/gcc-4.4.6 --enable-language=c,c++,java

报错,说找不到GMP和MPFR:

3/ 下载并安装依赖:
ftp://gcc.gnu.org/pub/gcc/infrastructure

gmp-4.3.2.tar.bz2

mpfr-2.4.2.tar.bz2

解压安装依赖:

tar -jxvf gmp-4.3.2.tar.bz2
mkdir /usr/local/gmp-4.3.2
cd ./gmp-4.3.2
./configure --prefix=/usr/local/gmp-4.3.2
make
make install

tar -jxvf mpfr-2.4.2.tar.bz2
mkdir /usr/local/mpfr-2.4.2
cd ./mpfr-2.4.2
./configure --prefix=/usr/local/mpfr-2.4.2 --with-gmp=/usr/local/gmp-4.3.2
make
make install

4/ 继续安装gcc:

./configure --prefix=/usr/bin/gcc-4.4.6 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --enable-language=c,c++,java
make
make install

 

你可能感兴趣的:(C/C++)