how to build DLLs with Cygwin

Will Ware wware at world.std.com
Sat Oct 28 11:34:14 EDT 2000


Greg Landrum (glandrum at my-deja.com) wrote:

> I assume that you were looking for instructions on how to do this. :-)

Wow, that's embarassing! You're right, and thanks for your accurate
telepathy, and the helpful links. My dog woke me up early and I tried
posting before I was coherent, so it could be said that my dog ate my
posting. (It would have been so helpful to have been a dog owner in
college.)

Anyway, here is what I had been doing:
--- start ---
SET MAKE_MODE=unix
SET PATH=C:\cygwin\bin;C:\cygwin\usr\local\bin;%PATH%
gcc -Ic:\Python20\Include -c -o foo.o foo.c
echo EXPORTS > foo.def
nm foo.o | grep "^........ [T] _" | sed "s/[^_]*_//" >> foo.def
dlltool --def foo.def --output-exp foo.exp --output-lib foo.a --dllname foo.dll
ld -o foo.dll foo.exp foo.o
--- finish ---

but I kept getting messages like this, indicating the ld.exe did not
know it should build a DLL but thought it should build an EXE:
foo.o(.text+0x28):foo.c: undefined reference to `_imp__PyArg_ParseTuple'
I assume that DLLs, like shared object files in Unix, ought to be able
to defer the last bit of the link process until they are invoked by an
executable.

Anyway, thanks again for telepathy and links.

-- 
# - - - - - - - - - - - - - - - - - - - - - - - -
# Resistance is futile. Capacitance is efficacious.
# Will Ware	email:    wware @ world.std.com



More information about the Python-list mailing list