Subject: Re: [Boost-build] Problem linking iostream with zlib support under Windows
From: k h (xerceslist.kh_at_[hidden])
Date: 2010-01-05 02:25:54
The following example uses boost::iostreams with zlib support. It works and
compiles fine under Linux (once the toolset is changed to gcc and the
__declspecs removed). This is with BOOST_BUILD_PATH, ZLIB_SOURCE, NO_BZIP2
set, and starting with a boost distribution that has just bjam (and nothing
It does not work under Windows however. Starting with an unpacked boost
distribution, it will compile compile zlib only to fail to find it almost
immediately afterwards when linking the dll. I have tried a small example
that uses a different boost library (e.g. date_time), and that compiles and
links fine with a substantially identical jamfile.
What do I change so the example below compiles under Windows without having
to do something like bjam --build-type=complete first? Many thanks.
Background: I am trying to make a demo distribution of a new library that
would download boost and then compile the library and (only) the necessary
parts of boost. This already works fine under Cygwin/Linux.
I'll be very grateful for any help.
==== Jamroot.jam ======
import boost ;
using msvc : 9.0express ;
lib l : lib.cpp /boost//iostreams : <link>shared:<define>BOOST_
exe blah : blah.cpp l ;
==== blah.cpp =======
extern __declspec(dllimport) void blah();
==== lib.cpp =======
namespace io = boost::iostreams;
__declspec(dllexport) void blah()
out << 123;
std::cout << "Done" << std::endl;
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk