windows

smk72@cornell.edu smk72@cornell.edu
Fri, 25 Oct 2002 09:29:15 -0400 (EDT)


Quoting Kevin Ryde <user42@zip.com.au>:

actually, after fiddling with it for a few hours, and 
setting the correct options in the config.h file as 
well as msvc++, i produced a working (tested) gmp 
4.1 .lib and a .dll. if anyone wants instructions, i 
can describe in more detail, and/or post a link to my 
website which is (as of now) hosting the new build. at 
the moment, it is a debug build, but i will rebuild it 
today, and get a release.

--sam

> 
> Others have been able to get msvc to compile it, but 
doing so from the
> main dist is probably doomed.  (Libtool doesn't 
understand ".lib"
> files for a start I don't think.)
> 
> We suggest a mingw dll, updated notes from the manual 
below.  If you
> use the debian mingw32 cross compile packages you can 
configure with
> 
>   ./configure --host=i586-mingw32msvc --disable-
static --enable-shared
> 
> 
> 
> Microsoft Windows
>      On systems `*-*-cygwin*', `*-*-mingw*' and `*-*-
pw32*' by default
>      GMP builds only a static library, but a DLL can 
be built instead
>      using
> 
>           ./configure --disable-static --enable-shared
> 
>      Static and DLL libraries can't both be built, 
since certain export
>      directives in `gmp.h' must be different.  `--
enable-cxx' cannot be
>      used when building a DLL, since libtool doesn't 
currently support
>      C++ DLLs.  This might change in the future.
> 
> Microsoft C
>      A MINGW DLL build of GMP can be used with 
Microsoft C.  Libtool
>      doesn't install `.lib' and `.exp' files, but 
they can be created
>      with the following commands, where 
`/my/inst/dir' is the install
>      directory (with a `lib' subdirectory).
> 
>           lib /machine:IX86 /def:_libs/libgmp-3.dll-
def
>           cp libgmp-3.lib /my/inst/dir/lib
>           cp _libs/libgmp-3.dll-
exp /my/inst/dir/lib/libgmp-3.exp
> 
>      MINGW uses `msvcrt.dll' for I/O, so applications 
wanting to use
>      the GMP I/O routines must be compiled with 
`cl /MD' to do the
>      same.  If one of the other I/O choices provided 
by MS C is desired
>      then the suggestion is to use the GMP string 
functions and confine
>      I/O to the application.
>