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的

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...