GCC 9.2.0构建错误:gmp.h的版本不正确,而版本实际上是正确的



我正在尝试构建一个交叉编译器,我选择了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模拟器

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

最新更新