たごもりすメモ

コードとかその他の話とか。

boost 1.46 で boost::filesystem の非互換に死んだ

scribedをまたぞろビルドしてたら、以下のようなエラーが出てコケた。いちおうメモ。

if g++ -DPACKAGE_NAME=\"scribe\" -DPACKAGE_TARNAME=\"scribe\" -DPACKAGE_VERSION=\"1.5.0\" -DPACKAGE_STRING=\"scribe\ 1.5.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"scribe\" -DVERSION=\"1.5.0\" -DUSE_SCRIBE_HDFS=1 -DHAVE_BOOST= -DHAVE_BOOST_SYSTEM= -DHAVE_BOOST_FILESYSTEM=  -I. -I.  -I.. -I/usr/local/include -I/usr/local/include/thrift -I/usr/local/include/thrift -I/usr/local/include/thrift/fb303 -I/usr/local/include -I/usr/include   -I/usr/java/jdk1.6.0_23/include -I/usr/java/jdk1.6.0_23/include/linux -I/usr/local/hadoop-0.20.2+320/src/c++/libhdfs  -Wall -O3 -MT file.o -MD -MP -MF ".deps/file.Tpo" -c -o file.o file.cpp; \
	then mv -f ".deps/file.Tpo" ".deps/file.Po"; else rm -f ".deps/file.Tpo"; exit 1; fi
file.cpp: In member function ‘virtual void StdFile::listImpl(const std::string&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)’:
file.cpp:248: error: ‘class boost::filesystem3::directory_entry’ has no member named ‘filename’

boostは現在の最新版 1.46.1 を使っている。
ググっても特にこれといって情報がないなあ、と思ったらboostの本家ドキュメントにばっちり書いてあった。知っている人は知っているのだろう。

Version 3 is a major revision with many new and improved features. It may, however, break some user code written for Version 2.

To ease the transition, Boost releases 1.44 through 1.47 will supply both V2 and V3. Version 2 is the default version for Boost release 1.44 and 1.45. Version 3 will be the default starting with release 1.46.

(中略)

Version 2 is deprecated, and will not be included in Boost releases 1.48 and later.

Filesystem Home

ありゃりゃ。で、その下の方にあった Filesystem Deprecated Features を見てみると、エラーになった呼び出しがばっちり書かれてる。残念でした。

なお scribed のビルドは、もう面倒だったので 1.45 を落としてきてやり直した。1.48になる前に本家のコードも boost::filesystem3 仕様に修正されてくれないとつらいなー。自分でやる気力はいまは無かった。