Boost logo

Boost Users :

From: Bo Peng (ben.bob_at_[hidden])
Date: 2006-12-20 12:49:03


Dear all,

I have tried several hours to link to a mingw built boost_iostreams
under windows without success. Out of desperation, I turned to linux
where I have a boost/cvs installed. Using a very simple test program:

#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/device/file.hpp>
namespace io = boost::iostreams;

int main(int argc, char ** argv)
{
        io::filtering_ostream ofs;
        ofs.push(io::gzip_compressor());
        ofs.push(io::file_sink("test.txt"));
        ofs << "this is a test script\n";
        return(0);
}

And
> g++ -I/usr/include/boost-1_35 -lboost_iostreams-gcc34-d test.cpp
would success and run fine, but
> g++ -I/usr/include/boost-1_35 -static -lboost__iostreams-gcc34-d test.cpp
will generate a bunch of undefined references like:

/tmp/cc2T22tx.o(.text+0x1af): In function `main':
: undefined reference to `boost::iostreams::zlib::default_strategy'
/tmp/cc2T22tx.o(.text+0x1c0): In function `main':
: undefined reference to `boost::iostreams::zlib::deflated'
/tmp/cc2T22tx.o(.text+0x1c6): In function `main':
: undefined reference to `boost::iostreams::zlib::default_compression'
/tmp/cc2T22tx.o(.gnu.linkonce.t._ZN5boost9iostreams21basic_gzip_compressorISaIcEEC1ERKNS0_11gzip_paramsEi+0x1e8):
In function `boost::iostreams::basic_gzip_compressor<std::allocator<char>
>::basic_gzip_compressor(boost::iostreams::gzip_params const&, int)':

Can anyone guess what is going on?

Bo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net