The Lazy Programmer

March 17, 2010

Building Boost 1.42 with zlib 1.2.4 support

Filed under: Programming — ferruccio @ 7:09 am

I am currently using Boost.IOStreams to read some compressed data out of a database. When I tried to user a zlib_decompressor object to deflate the incoming stream, it failed to compile. It turns out that you have to add zlib to the boost build process,  so I grabbed a copy of the latest zlib sources and made the necessary change to my boost build script (added -sZLIB_SOURCE=… so that could find the zlib sources).

Unfortunately the build failed. Bjam complained that it was missing a dependency (gzio.c). After a bit of trial and error with various options, I found the problem. I checked the zlib change log and it turns out that in version they removed the gzio.c file from the zlib sources.  Unfortunately, this was a very recent change so has not yet been updated to reflect the current zlib. (more…)

Blog at