Thanks. I just tried your idea on ubuntu and I get the linker errors too:
g++ -o"boostTest" ./src/boostTest.o
./src/boostTest.o: In function `void
boost::iostreams::detail::zlib_base::init (boost::iostreams::zlib_params const&, bool,
boost::iostreams::detail::zlib_allocator collect2: ld returned 1 exit status
make: *** [boostTest] Error 1 On 7/6/07, Ron Lau I can successfully compile the code with the add of one "using" statement
but the linker reports linker error. Code: // ...
#include int main()
{
using namespace std;
using namespace boost::iostreams; // Added this line.
ifstream file("hello.z", ios_base::in | ios_base::binary);
filtering_streambuf<input> in;
// ...
} Linker error:
g++ -ozlib.exe -lboost_iostreams-mgw34-mt-1_34 zlib.cpp
SOME/PATH/HERE/ccW0caaa.o(.text$_ZN5boost9iostreams6detail22zlib_decompressor_implISaIcEEC2Ei[boost::iostreams::detail::zlib_decompressor_impl ::zlib_decompressor_impl(int)]+0x46):zlib.cpp: undefined
reference to
`boost::iostreams::detail::zlib_base::zlib_base()'
SOME/PATH/HERE/ccW0caaa.o(.text$_ZN5boost9iostreams6detail22zlib_decompressor_implISaIcEEC2Ei[boost::iostreams::detail::zlib_decompressor_impl collect2: ld returned 1 exit status Built using Boost 1.34 with Multi-threading support, MinGW g++ 3.42 On 06/07/07, Meryl Silverburgh On 7/4/07, eg Meryl Silverburgh wrote: Hi, Can you please tell me how can I use boost iostream with zlib to
inflate an byte stream?
Where can I find an example? The library docs have some examples in them.
See:
http://boost.org/libs/iostreams/doc/index.html Navigate to the Quick Reference and click on the
"basic_zlib_decompressor" filter link. At the bottom of the page you
will see an example. I am having problems in compiling the example in the boost iostreams exmaple: code: #include <fstream>
#include <iostream>
#include int main()
{
using namespace std; ifstream file("hello.z", ios_base::in | ios_base::binary);
filtering_streambuf<input> in;
in.push(zlib_decompressor());
in.push (file);
boost::iostreams::copy(in, cout);
} error: g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/boostTest.d"
-MT"src/boostTest.d" -o"src/boostTest.o" "../src/boostTest.cpp"
../src/boostTest.cpp:18:2: warning: no newline at end of file
../src/boostTest.cpp: In function 'int main()':
../src/boostTest.cpp:13: error: 'filtering_streambuf' was not declared
in this scope
../src/boostTest.cpp:13: error: 'input' was not declared in this scope
../src/boostTest.cpp:13: error: 'in' was not declared in this scope
../src/boostTest.cpp:14: error: 'zlib_decompressor' was not declared
in this scope
make: *** [src/boostTest.o] Error 1 _______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users _______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users --
Regards,
Ron Lau Life is wonderful because there are variables and unknowns.
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users