问题描述
我正在尝试构建交叉编译器,所以我选择了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的