【问题标题】:GCC 9.2.0 build error : incorrect version of gmp.h while the version is actually correctGCC 9.2.0 构建错误:gmp.h 的版本不正确,而版本实际上是正确的
【发布时间】:2020-09-07 16:30:20
【问题描述】:

我正在尝试构建一个交叉编译器,我选择了 gcc-9.2.0 所以当我运行时(来自 OSDev Wiki)

../gcc-9.2.0/configure --target=x86_64-elf --prefix="$HOME/opt/cross" --disable-nls --enable-languages=c,c++ --without-headers

我收到了这个错误

checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... no
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.

于是我查看了gmp.h库,版本是6.2.0

#define __GNU_MP_VERSION            6
#define __GNU_MP_VERSION_MINOR      2
#define __GNU_MP_VERSION_PATCHLEVEL 0

然后我尝试使用--with-gmp 选项,但我得到了同样的错误

我的平台:Windows 10 64-bit

我使用Cygwin-x86_64 作为 bash 模拟器

【问题讨论】:

    标签: windows gcc cygwin cross-compiling gmp


    【解决方案1】:

    好的,所以我发现了问题所在。我为 Code::Blocks 安装了另一个 gcc 编译器,它位于 PATH 变量中,所以 ./configure 采用了这个编译器,而不是 cygwin 的

    【讨论】:

      猜你喜欢
      • 2014-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-20
      • 2023-01-16
      • 1970-01-01
      • 2014-12-23
      • 1970-01-01
      相关资源
      最近更新 更多