5
をコンパイルするページをフィルタリング:エラーを返し++ブーストGzipでフィルタ:私はブーストをGzipから例をコンパイルしようとしているfailes
#include <fstream>
#include <iostream>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/gzip.hpp>
int main()
{
using namespace std;
ifstream file("hello.gz", ios_base::in | ios_base::binary);
filtering_streambuf<input> in;
in.push(gzip_decompressor());
in.push(file);
boost::iostreams::copy(in, cout);
}
は、悲しいことに、私のG:この機能で間違って何
gzlib.cpp: In function ‘int main()’:
gzlib.cpp:12:3: error: ‘filtering_streambuf’ was not declared in this scope
gzlib.cpp:12:23: error: ‘input’ was not declared in this scope
gzlib.cpp:12:30: error: ‘in’ was not declared in this scope
gzlib.cpp:13:29: error: ‘gzip_decompressor’ was not declared in this scope
とどのようにそれを動作させるために変更しますか?どうもありがとう!
リンクGzipでフィルタを後押しする:http://www.boost.org/doc/libs/release/libs/iostreams/doc/classes/gzip.html
エラーが多いので、pastebinに出力しました。私のBoostが正しく動作しないことがありますか? http://pastebin.com/fG2ZqpaJ – ghostmansd
@ghostmansd:[ここ](http://www.boost.org/doc/libs/release/libs/iostreams/doc/classes/gzip.html#installation)に記載されているように、これを行うには 'zlib'にリンクする必要があります。 'zlib'は' boost'の外部にありますが、通常はUNIXシステムにプリインストールされていますが、[here](http://zlib.net/)からダウンロードできます。 – Mankarse
私は-lzを使ってコンパイルしますが、それは役に立ちません。 – ghostmansd