Unable to create shared libraries with MinGW

Roel Schroeven rschroev_nospam_ml at fastmail.fm
Wed Mar 7 10:12:18 CET 2007


Hi,

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


Any ideas what I can do to use GMP with MS Visual Studio?

-- 
If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

Roel Schroeven



More information about the gmp-discuss mailing list