Unable to create shared libraries with MinGW
Marek Marcola
Marek.Marcola at malkom.pl
Thu Mar 8 12:41:44 CET 2007
Hello,
> I'm trying to build GMP for use with Visual Studio. I'm using MinGW to
> do that. Since static libraries created by MinGW are not compatible with
> Visual Studio (AFAIK), I'm trying to create shared libraries. I used
>
> $ ./configure --enable-shared --disable-static --enable-fat
> $ make
>
> But at the end of the process, that results with errors (undefined
> references):
>
> gcc -shared .libs/libgmp.la-2.o -m32 -mtune=pentium4 -march=pentium4
> -mno-cygwin -Wl,--export-all-symbols -Wl,--output-def
> -Wl,.libs/libgmp-3.dll.def -o .libs/libgmp-3.dll
> -Wl,--image-base=0x10000000 -Wl,--out-implib,.libs/libgmp.dll.a
> Creating library file: .libs/libgmp.dll.a
> ..libs/libgmp.la-2.o(.text+0x272e):addsub_n.c: undefined reference to
> `__gmpn_add_nc'
> ..libs/libgmp.la-2.o(.text+0x2755):addsub_n.c: undefined reference to
> `__gmpn_sub_nc'
> ..libs/libgmp.la-2.o(.text+0x2845):addsub_n.c: undefined reference to
> `__gmpn_sub_nc'
> ..libs/libgmp.la-2.o(.text+0x286c):addsub_n.c: undefined reference to
> `__gmpn_add_nc'
> ..libs/libgmp.la-2.o(.text+0x292e):addsub_n.c: undefined reference to
> `__gmpn_add_nc'
> ..libs/libgmp.la-2.o(.text+0x2958):addsub_n.c: undefined reference to
> `__gmpn_sub_nc'
> collect2: ld returned 1 exit status
> make[2]: *** [libgmp.la] Error 1
> make[2]: Leaving directory `/home/Roel/build/gmp-4.2.1'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/Roel/build/gmp-4.2.1'
> make: *** [all] Error 2
>
You may need to apply patch:
http://gmplib.org/patches/x86-fat.diff
and then recompile.
Best regards,
--
Marek Marcola <Marek.Marcola at malkom.pl>
More information about the gmp-discuss
mailing list