[Patches] zlib build problems.

Guido van Rossum guido@python.org
Thu, 06 Apr 2000 09:21:23 -0400


> Im trying to build the zlib module I came across some wierdness.  If
> the problem is as simple as I think it is, then patches is
> appropriate for the discussion :-)
> 
> Im building zlib itself from sources, rather than using the
> binaries.  Im using the static zlib library.  This combination
> produced linker errors.
> 
> The following patch made everything work:
> 
> diff -c -2 -r2.30 zlibmodule.c
> *** zlibmodule.c	2000/02/29 13:59:24	2.30
> --- zlibmodule.c	2000/04/06 01:36:18
> ***************
> *** 5,9 ****
>   #include "Python.h"
>   #ifdef MS_WIN32
> - #define ZLIB_DLL
>   #endif
>   #include "zlib.h"
> --- 5,8 ----

I got rid of the #ifdef MS_WIN32 ... #endif as well :-)

> ie, we do not want to define ZLIB_DLL, as we are using the static
> ZLIB library.
> 
> [I assume we _are_ trying to use the static lib - checkin of
> revision 1.6 says we are :-]

Yes we are.  Using the DLL version is madness -- too many incomaptible
zlib.dll files around.

> So, the question I had was "how did this work for Guido et al"?

Beats me.

> It appears that zlib.dsp is set to point to inconsistent
> directories.  The include files come from "..\..\zlib113", while the
> .lib file comes from "..\..\zlib113dll\static32\zlibstat.lib" - note
> that these are different directory structures.  That is the only
> reason I could come up with??

I doubt it.  The zlib113dll directory *only* contains binaries (.dll
and .lib files).  The zlib113 directory contains the sources from
which these binaries apparently were built.  Both were downloaded from
the websites mentioned in the top of the zlibmodule.c source file, and
extracted in the directory names suggested by the archive names.
Just to be sure I downloaded them again; the build goes fine.  I
decided not to change the extraction directory.

> I have not added a patch for the .dsp, but it does appear this needs
> to be changed, so that the .h and .lib files come from the same
> branch.  Further, once I applied this change, I added a
> "/nod:msvcrt" option to the Debug linker switch (not needed on the
> release build).  This silences a linker warning.

I've added that one to make you happy.

--Guido van Rossum (home page: http://www.python.org/~guido/)