__GMP_WITHIN_GMP error when building mpc-0.9 as dynamic library

niXman i.nixman at gmail.com
Fri Feb 17 15:16:20 CET 2012

Hello list!

At attempt to build mpc-0.9 [1] as dynamic library (--enable-shared)
for MinGW, I receive such errors:
> configure:12385: i686-pc-mingw32-gcc -o conftest.exe  -O3 -pipe
> -fomit-frame-pointer -momit-leaf-frame-pointer -I/mingw-libs/include
> -D_FORTIFY_SOURCE=2 -g -std=c99 -pedantic -Wno-long-long -Wall -Wextra
> -Werror -Wdeclaration-after-statement -Wundef -Wshadow
> -Wmissing-prototypes -Wno-unused-value -I/mingw-libs/include
> -I/mingw-libs/include  -L/mingw-libs/lib -L/mingw-libs/lib  -pipe -s
> -L/mingw-libs/lib conftest.c -lmpfr -lgmp  >&5
> In file included from C:/msys/mingw-libs/include/mpfr.h:39:0,
>                  from conftest.c:36:
> C:/msys/mingw-libs/include/gmp.h:172:5: error: "__GMP_WITHIN_GMP" is
> not defined [-Werror=undef]
> C:/msys/mingw-libs/include/gmp.h:287:5: error: "__GMP_WITHIN_GMPXX" is
> not defined [-Werror=undef]
In a static build no errors.

To solve this problem, I have to add:
   for CFLAGS.

Perhaps it should not be so?

1. http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz
Regards, niXman.

More information about the gmp-bugs mailing list