VS2017下boost的編譯安裝

1.VS2017下boost編譯安裝
    a.cmd.exe
    b.運行bootstrap.bat產生b2.exe
    d.C:\Program Files (x86)\Windows Kits\8.1\bin\x64\mt.exe 拷貝到b2.exe同級目錄
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64添加到環境變量path裏,cl.exe能用
    c.運行b2.exe指令
    
        stage方式:x64動態庫編譯(只生成lib,dll)
            b2 --stagedir="C:\boost_1_59_0_stage\x64_v140" --build-dir="C:\boost_1_59_0_stage\build" link=shared link=static address-model=64  runtime-link=shared threading=multi release debug
            
        install方式:x64動態庫編譯(生成include和lib,dll)
            b2.exe install --prefix="C:\boost_1_59_0\x64_v140"  --build-dir="C:\boost_1_59_0\build" link=shared link=static address-model=64  runtime-link=shared threading=multi release debug

        
        toolset:指定編譯器,可選的如borland、gcc、msvc(VC6)、msvc-9.0(VS2008)等。
        without/with:選擇不編譯/編譯哪些庫。因爲python、mpi等庫我都用不着,所以排除之。
        stage/install:stage表示只生成庫(dll和lib),install還會生成包含頭文件的include目錄    
        stagedir/prefix:stage時使用stagedir,install時使用prefix,表示編譯生成文件的路徑。
        build-dir:編譯生成的中間文件的路徑。
        link:生成動態鏈接庫/靜態鏈接庫。生成動態鏈接庫需使用shared方式,生成靜態鏈接庫需使用static方式。
        runtime-link:動態/靜態鏈接C/C++運行時庫。同樣有shared和static兩種方式
        threading:單/多線程編譯。一般都寫多線程程序,當然要指定multi方式了;如果需要編寫單線程程序,那麼還需要編譯單線程庫,可以使用single方式。
        debug/release:編譯debug/release版本。一般都是程序的debug版本對應庫的debug版本,所以兩個都編譯。
        (from http://www.cnblogs.com/cmranger/p/4759223.html)


        


            

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章