c++ - 如何在 CentOS 6 x64 上构建 gcc 4.7.2

标签 c++ linux gcc centos centos6

我正在尝试在 CentOS 上构建最新的(在撰写本文时)GCC 版本。 我下载并构建了 GMP、MPFR 和 MPC。这些库位于/usr/local 下(即库的 usr/local/lib 和包含的/usr/local/include)。现在我正在尝试配置 GCC 以使用以下命令进行构建:

./configure --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local

我收到以下错误消息:

checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify their locations.

可能是什么原因?库已构建,位置正确,头文件已识别,但库本身不是。我也试过这个:

./configure --with-gmp-lib=/usr/local/lib \
--with-mpfr-lib=/usr/local/lib --with-mpc-lib=/usr/local/lib

但结果是一样的。

最佳答案

强烈推荐使用 GCC SRC (http://www.gnu.org/software/gsrc/)

您需要先安装 Python 和 bzr。

然后在配置之后(gsrc 网页中的步骤),只需在 gsrc 目录中执行这些操作

制作-C gnu/gcc
make -C gnu/gcc 安装

关于c++ - 如何在 CentOS 6 x64 上构建 gcc 4.7.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12590096/

相关文章:

linux - 为什么不同用户的 shell 看起来不同?

c - 查找 C 程序 (.exe) 中已使用的所有库的列表

c - printf 和 long double

c++ - 尝试编写一个 C++ 函数来对 8 位字符进行非十六进制编码并将其转换为整数

php - Linux 和 Php : server with MySQL database with terminal

c++ - 使用 g++ 构建用于 MSVC 应用程序的 dll

linux - 如何在后台自动运行bash脚本?

c++ - 在 for 循环中反转?

c++ - 查找数字的数字根

c++ - 内存泄漏在哪里