Boost logo

Boost-Build :

Subject: Re: [Boost-build] bjam and libraries
From: k h (xerceslist.kh_at_[hidden])
Date: 2009-12-25 11:22:23

> The .lib file is not created because you're exporting nothing from your
> library. Change the following line

Many thanks, and sorry for asking a question that turned out to be
completely unrelated to Boost. Your fix worked fine, and I am hoping that
with it in place I should be able to get the code to compile using a
portable jamfile?

It now works better, so the counterexample is a little longer. Again, the
addition of <link>static makes the code compile, but this time it complains
about multiply defined symbols within zlib if it is not specified. What am
I doing wrong this time? Many thanks.

import boost ;
boost.use-project ;

using msvc : : "D:/Program Files/Microsoft Visual Studio 9.0/VC/bin/cl.exe"

BOOST_LIB = d:/boost_1_41_0/stage/lib ;

lib mylib : testlib.cpp :
   <link>static #breaks if this is removed

exe testmain : testmain.cpp : <library>mylib <library-path>$(BOOST_LIB) ;


#include <ostream>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/filter/zlib.hpp>
#include <boost/config/warning_disable.hpp>

namespace io = boost::iostreams;

__declspec(dllexport) void blah ()
    io::filtering_ostream out;



extern void blah (void);

int main ()
  blah ();

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at