Predator's Vision

画像処理、3D点群処理、DeepLearning等の備忘録

VS2013 で Boost 1.55.0 をビルド

VS2013 での Boost 1.55.0 のビルドのメモ。あるヘッダーファイルに修正を加えてからでないとビルドが成功しなかった。

環境

エラー内容

c:\Boost\boost_1_55_0\boost/archive/iterators/transform_width.hpp(151) : error C2039: 'min' : 'std' のメンバーではありません。
c:\Boost\boost_1_55_0\boost/archive/iterators/transform_width.hpp(151) : error C3861: 'min': 識別子が見つかりませんでした

修正箇所

#include <boost/config.hpp>
#include <boost/serialization/pfto.hpp>
#include <algorithm>    // 追加箇所

#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_traits.hpp>

最終的なビルド手順

  1. Boostのソースをダウンロードして解凍する。今回はC:\Boost下に解凍。
  2. boost/archive/iterators/transform_width.hppを上述の通り修正
  3. 開発者コマンドプロンプトを開く
  4. コマンドを入力してビルド、インストール
    • パラメータの意味は次の通り
      • toolset: msvc-12.0 (VS2013) のコンパイラを使用
      • link: static link library (.lib) か dynamic link library (.dll) か
      • runtime-link: C/C++ランタイムライブラリを static link するか dynamic link するか
      • address-model: 32bit か 64bit か
      • build-dir: ビルド用ディレクトリ
      • stagedir: libを出力する場所
      • j: このビルドをする際に使用するCPUコア数 (並列処理)
      • install --prefix: インストール先
> cd C:\Boost\boost_1_55_0
> bootstrap.bat
> b2.exe toolset=msvc-12.0 link=static runtime-link=static,shared --build-dir=build/x64 --stagedir=stage/x64 address-model=64 -j 8 install --prefix="../"