路傍のプログラマ

只のプログラマが綴る愚痴と備忘録

メモ: boost 1.36, VC++ 2008 SP1

2008-08-27 19:18:56 | プログラミング
自分用メモ。
boost 1.36を、VC++ 2008 SP1向けにインストール。

(1) ダウンロードして、
c:¥boost_1_36_0
に展開。

(2) rmknさんのページを参考に、bjamを作成。
http://d.hatena.ne.jp/mrkn/20080212/1202801069

pushd c:¥boost_1_36_0¥tools¥jam¥src
build.bat
copy bin.ntx86¥bjam.exe ..¥..¥..
cd ..¥..¥..

(3) アールケー開発さんのページを参考に、コンパイル。
http://www.rk-k.com/memo/017.html

bjam.exe --toolset=msvc-9.0 --without-python --without-regex --stagedir=. link=static runtime-link=shared release stage
bjam.exe --toolset=msvc-9.0 --without-python --without-regex --stagedir=. link=static runtime-link=shared debug stage
bjam.exe --toolset=msvc-9.0 --without-python --without-regex --stagedir=. link=static runtime-link=static release stage
bjam.exe --toolset=msvc-9.0 --without-python --without-regex --stagedir=. link=static runtime-link=static debug stage
bjam.exe --toolset=msvc-9.0 --without-python --without-regex --stagedir=. link=shared runtime-link=shared release stage
bjam.exe --toolset=msvc-9.0 --without-python --without-regex --stagedir=. link=shared runtime-link=shared debug stage
bjam.exe --toolset=msvc-9.0 --without-python --without-regex --stagedir=. link=shared runtime-link=static release stage
bjam.exe --toolset=msvc-9.0 --without-python --without-regex --stagedir=. link=shared runtime-link=static debug stage

あとは、

(4) boostを使ったプログラムをコンパイルするときに、

ライブラリのパスとして、
C:¥boost_1_36_0¥lib
を指定。

(ちなみに、このディレクトリの中身は1.8GBくらい)

あってるかなあ。

以下蛇足。

boost::conditionに関しての変更

boost::conditionがboost::condition_variable_anyとboost::condition_variableに分化。boost::conditionはcondition_variable_anyの別名になっていた。

後者はメンバ関数のwait()に boost::unique_lockのインスタンスを渡さないといけないかわりに、最適化してあるそうな。

今までは、
#include <boost/thread.hpp>
だけでboost::conditionを使えたけれど、

1.36からは、明示的に、
#include <boost/thread/condition.hpp>
としないといけない。

(2008/09/04 一部修正)