GMP dll for windows: linking errors

Kevin Ryde user42@zip.com.au
Fri, 18 Jul 2003 08:05:10 +1000


Lesley MacPherson <la2macph@math.uwaterloo.ca> writes:
>
> Everything is fine till I get to the linking stage, where I get a few
> unresolved external symbol errors for _vsnprintf, _snprintf, _strnlen, and
> __imp__MessageBoxA@16.  At least two of these (_vsnprintf and _snprintf)
> are supposed to be in libc.lib, which is included in my project workspace.

vsnprintf and snprintf might have an extra "_" in the library, mingw
headers have a bit of an inline to get that added.

strnlen is apparently not in the basic ms runtime, according to
mingw.  If you ensure HAVE_STRNLEN in the gmp config.h is not defined
then it won't be used.

Dunno what MessageBoxA is.

> I used cygwin to generate the gmp.h and config.h files as described on the
> link above.  I have heard of people using MinGW instead.  Any thoughts on
> which is better (cygwin or MinGW) and instructions on how to create a dll
> using MinGW?

mingw is a lot closer to the bare bones ms stuff than cygwin.  Perhaps
for instance cygwin has strnlen where mingw doesn't.  I'd expect more
joy from mingw.