Compiling GMP to work under Visual Studio

Jim Fougeron. jfoug at
Fri Mar 5 18:11:23 CET 2004

I personally do not use Cygwin (I have found MinGW to be a better
system for what I need). However, I have seen similar problems,
and will explain how I worked around them.

You will also have to link in libgcc.a from your Cygwin environment,
along with the libgmp.a library.  That will allow usage of the alloca
functions (which help the performance of GMP quite a bit). As for
the _snprinf, I am not sure if it is located in the libgcc.a file
(I do not get that linkage error, so have not tried to fix it before).

Hope the above helps,  Jim.

>I have used CygWin to build GMP for the windows environment.
>If I understand right, the library I need to use is .libs\libgmp.a
>However, it doesn't seem to work well, I get "unresolved external
>symbol" message for 4 variables:
>does anybody have a clue what should I do? I spent more than 2 days
>working on it thus far...
>I even tried to create a Visual Studio project out of it - everything
>finally compiles but it still didn't work at the end...
>Thanks if anybody knows how to help me,

More information about the gmp-discuss mailing list