[Boost.Iostreams] Building iostreams with zlib support

Hi,
I'm trying to compile the following example code on Windows XP using
MS Visual Studio 2005:
-- from http://www.boost.org/libs/iostreams/doc/classes/zlib.html#installation
//////////////////////////////
#include <fstream>
#include <iostream>
#include

Andreas Profous wrote:
As I understand it I have to rebuild boost.iostreams with zlib support: C:\boost\boost_1_34_1\libs\iostreams\build>bjam "-sNO_COMPRESSION=0" "-sNO_ZLIB=0" "-sZLIB_SOURCE=C:\Libs\zlib123" "-sZLIB_LIBPATH=C:\Libs\zlib123\dll32" "-sZLIB_BINARY=zlibwapi.dll"
I tried this and that but to be honest I don't really know what I'm doing and it didn't work.
When I did it, I found that I ONLY set the zlib path environment variables... zlib_libpath, zlib_source, and zlib_include. In fact, I just set them as explicit environment variables and then called bjam with the correct toolset. I did not do anything with no_zlib or no_compression or zlib_binary (IIRC they caused me problems). You could try that and see if it works for you.

Hi, eg wrote:
Andreas Profous wrote:
As I understand it I have to rebuild boost.iostreams with zlib support: C:\boost\boost_1_34_1\libs\iostreams\build>bjam "-sNO_COMPRESSION=0" "-sNO_ZLIB=0" "-sZLIB_SOURCE=C:\Libs\zlib123" "-sZLIB_LIBPATH=C:\Libs\zlib123\dll32" "-sZLIB_BINARY=zlibwapi.dll"
I tried this and that but to be honest I don't really know what I'm doing and it didn't work.
Same problem with boost 1.35.0. Using the "-sZLIB..." parameters did not work for me, too.
When I did it, I found that I ONLY set the zlib path environment variables... zlib_libpath, zlib_source, and zlib_include. In fact, I just set them as explicit environment variables and then called bjam with the correct toolset.
I did not do anything with no_zlib or no_compression or zlib_binary (IIRC they caused me problems).
Thanks for the hint. I also set the environment variables (in my case ZLIB_LIBPATH, ZLIB_SOURCE, ZLIB_INCLUDE and ZLIB_BINARY), and this worked. Best regards, Lothar

Hi Andreas, I also got stuck when trying to use zlib in iostreams and found the documentation not very helpful. The "Getting started on Microsoft Windows" is a bit "unorganized" and outdated. That was mentioned before in another thread.
As I understand it I have to rebuild boost.iostreams with zlib support: C:\boost\boost_1_34_1\libs\iostreams\build>bjam "-sNO_COMPRESSION=0" "-sNO_ZLIB=0" "-sZLIB_SOURCE=C:\Libs\zlib123" "-sZLIB_LIBPATH=C:\Libs\zlib123\dll32" "-sZLIB_BINARY=zlibwapi.dll"
I tried this and that but to be honest I don't really know what I'm doing and it didn't work.
What worked for me was C:\boost\boost_1_34_1\libs\iostreams\build>bjam "-sNO_ZLIB=0" "-sZLIB_SOURCE=C:\Libs\zlib123" You have to think about the threading and linking options (look for the specific keywords). Then some libs with "lib" prefix (for static linking) and without that prefix (dynamic linking) should be built as well as the corresponding DLLs. When you use dynamic linking, make sure to add BOOST_ALL_DYN_LINK to your defines. You may also have a look at http://www.codeproject.com/KB/tips/Building_boost_libraries.aspx which was helpful for me. Best regards, Rainer
participants (4)
-
Andreas Profous
-
eg
-
Lothar May
-
Rainer Thaden