Search code examples
windowsgcccygwincross-compilinggmp

GCC 9.2.0 build error : incorrect version of gmp.h while the version is actually correct


I am trying to build a cross-compiler and I chose gcc-9.2.0 So when i run ( from the OSDev Wiki)

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

I got this error

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.

So I checked the gmp.h library and the version is 6.2.0

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

Then i tried to use the --with-gmp option, but i got the same error

My platfrom : Windows 10 64-bit

I use Cygwin-x86_64 as a bash emulator


Solution

  • Ok so i found what was wrong. I had installed another gcc compiler for Code::Blocks and it was in PATH variable, so ./configure took this compiler and not the cygwin's