bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

4.1.3 and mpfr


From: Sisyphus
Subject: 4.1.3 and mpfr
Date: Wed, 05 May 2004 12:31:22 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313

Hi,

On win32 (MinGW compiler in the MSYS shell) I built GMP-4.1.2 with:
./configure --disable-static --enable-shared --enable-mpfr

Then cd to '.libs' and build a 'libgmp.lib' by running:
lib /out:libgmp.lib /def:libgmp-3.dll-def

Then cd to 'mpfr' and build a 'libmpfr.lib' by running:
lib /out:libmpfr.lib *.o

I then have all the files I need to build with VC 7 (as well as MinGW) - and everything works fine.

So ... I repeated the same procedure with GMP-4.1.3. Everything still works fine with MinGW, but with VC 7, when I build an mpfr app, I get the errors pertaining to '_alloca'. Here's a simple test script:

-------------------------------------------
#include <stdio.h>
#include <gmp.h>
#include <mpfr.h>

/* Additional header for Microsoft Visual Studio */
/* Stolen from MinGW/include/string.h */

#ifdef _MSC_VER
strcasecmp (const char * __sz1, const char * __sz2)
  {return _stricmp (__sz1, __sz2);}

strncasecmp (const char * __sz1, const char * __sz2, size_t __sizeMaxCompare)
  {return _strnicmp (__sz1, __sz2, __sizeMaxCompare);}
#endif

int main() {
    mpfr_t x;

    mpfr_init_set_ui(x, 75, GMP_RNDN);
    mpfr_log10(x, x, GMP_RNDN);
    mpfr_out_str(stdout, 10, 0, x, GMP_RNDN);

return 0;
}
----------------------------------------------

It builds and runs fine under 4.1.2, but under 4.1.3 compilation produces the following:

----------------------------------------------
D:\vctest-4.1.3>cl test.c libmpfr.lib libgmp.lib libc.lib msvcrt.lib
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86
Copyright (C) Microsoft Corporation 1984-2001. All rights reserved.

test.c
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:test.exe
test.obj
libmpfr.lib
libgmp.lib
libc.lib
msvcrt.lib
libmpfr.lib(add1.o) : error LNK2001: unresolved external symbol __alloca
libmpfr.lib(sub1.o) : error LNK2019: unresolved external symbol __alloca referenced in function _mpfr_sub1
libmpfr.lib(div_ui.o) : error LNK2001: unresolved external symbol __alloca
libmpfr.lib(sqrt.o) : error LNK2001: unresolved external symbol __alloca
libmpfr.lib(mul_ui.o) : error LNK2019: unresolved external symbol __alloca referenced in function _mpfr_mul_ui libmpfr.lib(const_log2.o) : error LNK2019: unresolved external symbol __alloca referenced in function _mpfr_aux_log2 libmpfr.lib(const_pi.o) : error LNK2019: unresolved external symbol __alloca referenced in function _mpfr_aux_pi libmpfr.lib(agm.o) : error LNK2019: unresolved external symbol __alloca referenced in function _mpfr_agm libmpfr.lib(round_prec.o) : error LNK2019: unresolved external symbol __alloca referenced in function _mpfr_round_prec libmpfr.lib(div.o) : error LNK2019: unresolved external symbol __alloca referenced in function _mpfr_div libmpfr.lib(log.o) : error LNK2019: unresolved external symbol __alloca referenced in function _mpfr_log libmpfr.lib(mul.o) : error LNK2019: unresolved external symbol __alloca referenced in function _mpfr_mul
test.exe : fatal error LNK1120: 1 unresolved externals

----------------------------------------------

I'm assuming that the 'mpfr' source has not changed between versions 4.1.2 and 4.1.3, which by my reasoning makes this a gmp (not mpfr) issue. Apologies if either my assumption or reasoning is flawed :-)

Cheers,
Rob

--
Any emails containing attachments will be deleted from my ISP's mail
server before I even get to see them. If you wish to email me an
attachment, please provide advance warning so that I can make the
necessary arrangements.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]