天天看點

vs2010下編譯Boost 1.46

1 下載下傳boost

2 解壓boost

3 編譯bjam.exe:進入VS2010的Command Prompt,切換目錄到boost解壓目錄下的子目錄tools\build\v2\中,運作其中的bootstrap.bat,在目前目錄中會生成bjam.exe,

  将bjam.exe拷貝到解壓目錄中;

4 修改tools\build\v2\user-config.jam,在# MSVC configuration欄目的最後面補充一句using msvc : 10.0;如下:

# -------------------

# MSVC configuration.

# -------------------

# Configure msvc (default version, searched for in standard locations and PATH).

# using msvc ;

# Configure specific msvc version (searched for in standard locations and PATH).

# using msvc : 8.0 ;

using msvc : 10.0;

5 将VS2010的Command Prompt的目錄轉至boost加壓目錄下,然後輸入:bjam --toolset=msvc-10.0 --build-type=complete stage 後開始編譯,

編譯完成,生成的庫檔案位于解壓目錄的子目錄/stage/lib下

6 将加壓目錄的子目錄 /boost 和stage/lib分别加到vs2010中即可

boost加壓目錄是如下目錄:

boost_1_46_1\ .................The “boost root directory”
   index.htm .........A copy of www.boost.org starts here
   boost\ .........................All Boost Header files
   lib\ .....................precompiled library binaries
   libs\ ............Tests, .cpps, docs, etc., by library
     index.html ........Library documentation starts here
     algorithm\
     any\
     array\
                     …more libraries…
   status\ .........................Boost-wide test suite
   tools\ ...........Utilities, e.g. bjam, quickbook, bcp
   more\ ..........................Policy documents, etc.
   doc\ ...............A subset of all Boost library docs      

繼續閱讀