Unable to create shared libraries with MinGW

Chris Saunders evas at mountaincable.net
Wed Mar 7 15:32:18 CET 2007


I use static libraries built with MSYS and MinGW along with Visual Studio
2005 without problems.

Regards,
Chris Saunders

-----Original Message-----
From: gmp-discuss-bounces at swox.com [mailto:gmp-discuss-bounces at swox.com] On
Behalf Of Roel Schroeven
Sent: Wednesday, March 07, 2007 4:12 AM
To: gmp-discuss at swox.com
Subject: Unable to create shared libraries with MinGW

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

_______________________________________________
gmp-discuss mailing list
gmp-discuss at swox.com
https://gmplib.org/mailman/listinfo/gmp-discuss



More information about the gmp-discuss mailing list