Hi,
OS is Vista64 on an AMD64 box.

I have a static build of the GMP library ( http://swox.com/gmp ) built
using the MinGW port of the gcc (32 bit) compiler.

Using Visual Studio 2005 (VC 8), there's no problem in accessing that
MinGW-built library:
---------------------------
C:\C>type try.c
#include
#include

int main() {
mpz_t a;
mpz_init_set_ui(a, 123);
if(!mpz_cmp_ui(a, 123)) printf("OK\n");
else printf("NOT ok\n");
mpz_clear(a);
return 0;
}


C:\C>cl /MD -IC:\_32\msys\1.0\local\include try.c
C:\_32\msys\1.0\local\lib\libgmp.a
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for
80x86
Copyright (C) Microsoft Corporation. All rights reserved.

cl : Command line warning D9024 : unrecognized source file type
'C:\_32\msys\1.0\local\lib\libgmp.a', object file assumed
try.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

/out:try.exe
try.obj
C:\_32\msys\1.0\local\lib\libgmp.a

C:\C>try
OK
---------------------------

but when I use the 'cl' that ships with the Windows Server 2003 R2 SDK, I
get the following when I try to compile the same C program:

---------------------------
C:\C>cl /MD -IC:\_32\msys\1.0\local\include try.c
C:\_32\msys\1.0\local\lib\libgmp.a
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40310.41 for AMD64
Copyright (C) Microsoft Corporation. All rights reserved.

cl : Command line warning D9024 : unrecognized source file type
'C:\_32\msys\1.0\local\lib\libgmp.a', object file assumed
try.c
Microsoft (R) Incremental Linker Version 8.00.40310.39
Copyright (C) Microsoft Corporation. All rights reserved.

/out:try.exe
try.obj
C:\_32\msys\1.0\local\lib\libgmp.a
try.obj : error LNK2019: unresolved external symbol __gmpz_clear referenced
in function main
try.obj : error LNK2019: unresolved external symbol __gmpz_cmp_ui referenced
in function main
try.obj : error LNK2019: unresolved external symbol __gmpz_init_set_ui
referenced in function main
try.exe : fatal error LNK1120: 3 unresolved externals
---------------------------

Renaming libgmp.a to libgmp.lib doesn't help (except that it eliminates the
"unrecognized source file type" warning). I still get the same linking
errors.
Is there a simple (for some definition of "simple" :-) way to use the
MinGW-built 32-bit library with Platform SDK's 64-bit compiler ?

Cheers,
Rob