cygwin and python21.lib: unresolved symbols

Karl M. Syring syring at
Sun Aug 12 04:54:58 CEST 2001

"Les Schaffer" <schaffer at> schrieb
> In trying to compile the python extension for cephes using cygwin tools, i
> ran into troubles in the link phase with complaints about missing symbols
> the form, for example, PyTuple_Type (_imp__PyTuple_Type).
> when i check a variety of python21.dll's using dependency walker, these
> symbols are shown exported. when i check with cygwin's nm:
>     nm python21.lib
> they are missing. so maybe this is a cygwin problem. they are not ALL
> missing, just some.
> has anyone else using cygwin run into these missing symbols?

You need to use the mingw tools version that link with msvcrt.dll, otherwise
you will end up in DLL hell.
Start from the python21.dll:
Extract a python21.def file with nm or dumpbin (caveat: some versions of nm
will say "no symbols"), then
  dlltool  --dllname python21.dll --def python21.def --output-lib
will give you the proper libpython21.a, works like a charm.

Karl M. Syring

More information about the Python-list mailing list