2014年4月15日 星期二

Boost Library + VS2010 編譯環境

1.官網抓檔案v1.55 & 解壓縮(http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.7z/download)

2.開啟VS2010命令列  進入解壓縮目錄

3.先執行bootstrap.bat

4.再執行bjam runtime-link=static  (這步驟約需數十分鐘)

以下指令各對應編譯出不同的lib,若執行時找不到就要重新編譯
mt - multitheaded, get it with "bjam threading=multi"
s -  "bjam runtime-link=static"   =====>很重要,最常用的MT編譯選項就是這個
d - debug bjam variant=debug

5.完成訊息

The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    D:/boost_1_55_0

The following directory should be added to linker library paths:

    D:\boost_1_55_0\stage\lib

6.VS2010使用
 (1) VS2010專案中加入
         Include目錄
         Lib目錄
 (2)去除使用先行編譯標頭檔
 (3)直接Include boost\xxx.hpp 即可使用




#include #include #include #include #include "windows.h" using namespace boost; using namespace std; void Thread_func(string A,string B,int C) { while(1) { cout << A<

1 則留言: