Help: Building PIL on Windows (.a ⇒ .dll)?

Sunday 3 February 2008This is over 16 years old. Be careful.

I’m trying to build PIL from sources on Windows, and I’m stuck. I hope someone will have a nugget of info that will get me going again.

The README in the PIL tarball says to download three prerequisites from GnuWin32: zlib, jpeg, and freetype, so I downloaded the -bin and -lib for each of those.

I added the GnuWin32 directories to the setup.py, and run it to build the extension. The PIL setup.py tries to sniff out the libraries it needs, and disables features that need missing libraries. It decides that zlib is present, but that jpeg and freetype are not.

Debugging through the setup.py code, it’s finding libz.a in the GnuWin32 lib directory. There is no libjpeg.a or libfreetype.a, so it claims they are not available. In fact, it looks for any of these names for jpeg: libjpeg.dylib, jpeg.dll, libjpeg.a, liblibjpeg.dylib, libjpeg.dll, or liblibjpeg.a. None of these are present.

In the bin directory, I have freetype6.dll and jpeg62.dll, but it won’t know to look for those numeric suffixes. Just copying files around and renaming them seems like the wrong way to go.

Searching for information, I find many cryptic pages discussing a2dll, o2dll, dlltool, and so on. I don’t understand them. Each time I try a new set of instructions, it points me to another piece of software I don’t think I have, and don’t know how to get. I feel like a total n00b. Can someone help?

Comments

[gravatar]
here's a good page with general info on building on windows (with 2.5; I wrote about how to do it in 2.4).

I remember having issues like this, but not what they were; it was a while ago.
[gravatar]
Have done this some months ago, since I needed tiff g4 support. I have followed these steps: http://www.wiredfool.com/2005/10/29/how-to-build-the-python-imaging-library-for-windows/

maybe that helps.
[gravatar]
Ned, after much frustration, here is how I got my Windows DLLs.
http://buggywhip.blogspot.com/2007/07/making-simple-dlls-simply.html

YMMV but best of luck, Larry

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
Comment text is Markdown.