building gmp with MSYS and MinGW for VC++

Radu Ursu rursu at geometryfactory.com
Sun May 9 10:08:09 CEST 2004


Sisyphus wrote:
> Kevin Ryde wrote:
> 
>> Sisyphus <kalinabears at iinet.net.au> writes:
>>
>>> I know I didn't specify that option when I built 4.1.2 - and wouldn't
>>> that affect *all* of GMP ?
>>
>>
>>
>> Well, what it sounds like is you used malloc in your 4.1.2 build and
>> mpfr applications, then built 4.1.3 with alloca (the default).  Hence
>> the mismatch trying to use the new dll with the old app.
>>
>> This arises in mpfr because mpfr uses various gmp internals.  You
>> should use mpfr with the libgmp it was built against.  (Or rebuild.)
>>
> 
> For the record, I stayed with the 4.1.3 that I built with the MinGW 
> compiler using the build options '--disable-static --enable-shared 
> --enable-mpfr'.
> 

I have chosen the same configuration.

> There weren't any problems rebuilding apps with MinGW, but a couple of 
> issues with mpfr apps and VC 7.
> 

I did not use mpfr yet. I will let you know if I'll get any problems 
with it. GMP works fine.

> Incidentally, I'm finding that when I build with VC 7, I'm having to 
> link explicitly to 'libc.lib' and 'msvcrt.lib'. (The same was also the 
> case with GMP-4.1.2.)

I only link with gmp.lib. I let Microsoft Compiler to choose the default 
wich is /ML(libc.lib). Microsoft tells people not to mix libc.lib with 
msvcrt.lib because those could generate conflicts. I have encountered 
myself such problems when I built some library using /MD(msvcrt.lib) and 
then using /ML(libc.lib) to build my application. The same for their 
debug versions.

Best regards,
Radu.



More information about the gmp-discuss mailing list