歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> 實戰准標准庫Boost

實戰准標准庫Boost

日期:2017/3/1 10:38:40   编辑:Linux編程

1. 下載並解壓Boost C++ Libs

下載地址:

SourceForge:http://sourceforge.net/projects/boost/files/boost/1.48.0/

Boost Official:http://www.boost.org/users/history/version_1_48_0.html (實際上也是從SourceForge下載)

解壓到 E:\boost_1_48_0

2. 編譯

打開VS2008,在菜單欄“工具”選擇“Visual Studio 2008 Command Prompt”,在彈出的控制台中,輸入:

  1. C:\Users\Michael>E:
  2. E:\>cd boot_1_48_0
  3. E:\>bjam --toolset=msvc-9.0 --build-type=complete stage

其中“--toolset=msvc-9.0”表示編譯成VS 9.0版本,因為VS 2008為VS 9.0版本,如果是VS 2010,則用“--toolset=msvc-10.0”參數。

編譯是很漫長的過程,如果你只需要使用Boost庫的一部分,可以選擇性地編譯。比如你只想用system,thread庫,則輸入:

E:\>bjam --toolset=msvc-9.0 --with-system -with-thread

3. 配置VS2008環境

在菜單欄的“工具”——“選項”——“項目和解決方案”——“VC++目錄”,“平台”選擇“Win32”。

“顯示以下內容的目錄”選擇“庫文件”,點擊“新建”按鈕,文件夾選擇“E:\boost_1_48_0\stage\lib”。

“顯示以下內容的目錄”選擇“包含文件”,點擊“新建”按鈕,文件夾選擇“E\boost_1_48_0”。

Copyright © Linux教程網 All Rights Reserved