Sorry, I have forgotten to write down the steps I have done.
After I have recompiled my iostreams library with zlib support, I have added a line in the source code.
// ...
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/zlib.hpp>
#include "/boost_1_34_0/libs/iostreams/src/zlib.cpp" // New included file added.
int main()
{
// ... details
}
That line is required as the implementation details of some zlib-related functions is placed in that file.
Although it is reported that in this post : "
http://thread.gmane.org/gmane.comp.lib.boost.user/16525/focus=16587", statically-linked library under Windows does not require that line, I've got those linker errors without it, as you did under Linux. And though the Installation guide from the official documentation states that we have to define "BOOST_IOSTREAMS_NO_LIB
" too, I can compile the source code successfully without it. Also, I have changed my command for compilation a bit.
Command:
g++ -ozlib.exe -lboost_zlib-mgw34-mt-1_34 -lboost_iostreams-mgw34-mt-1_34
zlib.cpp
Built using statically-linked Boost 1.34 with Multi-threading, zlib, bzip2 support, MinGW g++ 3.42